]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - src/bcar.cc
Merge branch 'free-leave-entries'
[hubacji1/bcar.git] / src / bcar.cc
index 4e635d6c395a9a8f72519f1c94ea6d2fb7b5252b..8234b6261b85b0b2ed14e44d906471dcd460ade3 100644 (file)
@@ -85,6 +85,14 @@ Point::inside_of(std::vector<Point> const& poly) const
        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
 {