diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/statistics_helpers.h b/Polyhedron/demo/Polyhedron/include/CGAL/statistics_helpers.h index 82a081b8083..fcb98812e87 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/statistics_helpers.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/statistics_helpers.h @@ -50,7 +50,6 @@ void compute_angles(Mesh* poly,Tester tester , double& mini, double& maxi, doubl typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename boost::property_map::type VPMap; typedef typename CGAL::Kernel_traits< typename boost::property_traits::value_type >::Kernel Traits; - double rad_to_deg = 180. / CGAL_PI; accumulator_set< double, features< tag::min, tag::max, tag::mean > > acc; @@ -67,12 +66,8 @@ void compute_angles(Mesh* poly,Tester tester , double& mini, double& maxi, doubl typename Traits::Point_3 b = get(vpmap, target(h, *poly)); typename Traits::Point_3 c = get(vpmap, target(next(h, *poly), *poly)); - typename Traits::Vector_3 ba(b, a); - typename Traits::Vector_3 bc(b, c); - double cos_angle = (ba * bc) - / std::sqrt(ba.squared_length() * bc.squared_length()); - - acc(std::acos(cos_angle) * rad_to_deg); + typename Traits::FT ang = CGAL::approximate_angle(b,a,c); + acc(CGAL::to_double(ang)); } mini = extract_result< tag::min >(acc); @@ -281,4 +276,3 @@ void faces_aspect_ratio(Mesh* poly, faces_aspect_ratio(poly, faces(*poly), min_altitude, mini, maxi, mean); } #endif // POLYHEDRON_DEMO_STATISTICS_HELPERS_H -