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
{
return sqrt(pow(p.x() - this->x_, 2.0) + pow(p.y() - this->y_, 2.0));
}
+bool
+Point::operator==(Point const& p)
+{
+ return this->x() == p.x() && this->y() == p.y();
+}
+
std::ostream&
operator<<(std::ostream& out, Point const& p)
{
return this->b_.edist(this->e_);
}
+double
+Line::h() const
+{
+ return atan2(this->e_.y() - this->b_.y(), this->e_.x() - this->b_.x());
+}
+
std::ostream&
operator<<(std::ostream& out, Line const& li)
{
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);
+}
+
+bool
+Pose::operator==(Pose const& p)
+{
+ return this->x() == p.x() && this->y() == p.y() && this->h() == p.h();
+}
+
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)
{