*/
bool inside_of(std::vector<Point> const& poly) const;
+ /*! \brief Return `true` if `this` point is inside the circle `c`, `r`.
+ *
+ * \see * https://math.stackexchange.com/questions/198764/how-to-know-if-a-point-is-inside-a-circle#198769
+ */
+ bool inside_of(Point const& c, double const r) const;
+
/*! \brief Return `true` if on the right side of the plane.
*
* The plane is given by the line `li`, where `li->b()` is the base
return c;
}
+bool
+Point::inside_of(Point const& c, double const r) const
+{
+ double dx = this->x() - c.x();
+ double dy = this->y() - c.y();
+ return pow(dx, 2.0) + pow(dy, 2.0) < pow(r, 2.0);
+}
+
bool
Point::on_right_side_of(Line const& li) const
{