*/
bool on_right_side_of(Line const& li) const;
+ /*! \brief Translate self.
+ *
+ * \param p `Point` offset to translate by.
+ */
+ void translate(Point const& p);
+
/*! \brief Rotate self around the point.
\param c Rotation center `Point`.
/*! Get heading's end in the interval [-pi, +pi] radians. */
double e() const;
+ void translate(Point const& p);
void rotate(Point const& c, double const angl);
-
void reflect(Line const& li);
friend std::ostream& operator<<(std::ostream& out, PoseRange const& p);
}
}
+void
+Point::translate(Point const& p)
+{
+ this->x_ += p.x();
+ this->y_ += p.y();
+}
+
void
Point::rotate(Point const& c, double const angl)
{
return std::max(this->bp_.h(), this->ep_.h());
}
+void
+PoseRange::translate(Point const& p)
+{
+ this->bp_.translate(p);
+ this->ep_.translate(p);
+ this->set_xyh();
+}
+
void
PoseRange::rotate(Point const& c, double const angl)
{
c.st(c.st() * -1.0);
}
}
- path.push_back(c);
return path;
}
ParkingSlot::recompute_entry(PoseRange p)
{
p.rotate(Point(0.0, 0.0), this->h());
- p.x(p.x() + this->lrx());
- p.y(p.y() + this->lry());
+ p.translate(this->border_[0]);
if (!this->right()) {
p.reflect(this->entry_);
}