]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/blobdiff - bcar/src/bcar.cc
Add arc len computation method to point
[hubacji1/iamcar2.git] / bcar / src / bcar.cc
index 44763d7c5a64fe7d89ee56f67f31e1e7c5f0e75a..01f479cd722198e87183e21c69b6702999debf1e 100644 (file)
@@ -145,6 +145,12 @@ Point::edist(Point const& p) const
        return sqrt(pow(p.x() - this->_x, 2.0) + pow(p.y() - this->_y, 2.0));
 }
 
+double
+Point::arc_len(Point const& p, double r)
+{
+       return 2 * r * asin(this->edist(p) / 2 / r);
+}
+
 void
 Point::gen_gnuplot_to(std::ostream& out)
 {