*/
void rotate(Point const& c, double const angl);
+ /*! \brief Compute reflection of `this` around the `Line`.
+ *
+ * \param li The plane to reflect around is given by `li`.
+ */
+ void reflect(Line const& li);
+
/*! Return Euclidean distance to `p`. */
double edist(Point const& p) const;
void rotate(Point const& c, double const angl);
+ void reflect(Line const& li);
+
friend std::ostream& operator<<(std::ostream& out, Pose 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);
};
this->y(ny + c.y());
}
+void
+Point::reflect(Line const& li)
+{
+ this->rotate(li.b(), -li.h());
+ this->y_ -= li.b().y();
+ this->y_ *= -1.0;
+ this->y_ += li.b().y();
+ this->rotate(li.b(), li.h());
+}
+
double
Point::edist(Point const& p) const
{
this->h(this->h() + angl);
}
+void
+Pose::reflect(Line const& li)
+{
+ Point::reflect(li);
+ double dh = li.h() - this->h();
+ this->h(this->h() + 2.0 * dh);
+}
+
std::ostream&
operator<<(std::ostream& out, Pose const& p)
{
this->e(this->e() + angl);
}
+void
+PoseRange::reflect(Line const& li)
+{
+ Pose::reflect(li);
+ double dh = li.h() - this->e();
+ this->e(this->e() + 2.0 * dh);
+}
+
std::ostream&
operator<<(std::ostream& out, PoseRange const& p)
{