Subject: CGAL users discussion list
List archive
- From: "Max" <>
- To: "" <>
- Subject: Re: [?? Probable Spam] [cgal-discuss] Calculate angle
- Date: Tue, 26 Aug 2008 09:29:30 +0800
- Organization: Max
>Hello,
>I want to get the angle value between three points but I only find the angle
>function that returns only the type of the angle.
>I would like to know if there is another function to help in this task.
>
try this
Point p1, p2, p3;
Vector v1 = p1-p2;
v1 = v1 / std::sqrt( v1 * v1);
Vector v2 = p3-p2;
v2 = v2 / std::sqrt( v2 * v2);
double angle = std::acos( v1 * v2 ) / CGAL_PI * 180;
any pre-condition checking code is omitted here.
B/Rgds
Max
- [cgal-discuss] Calculate angle, Simao Soares, 08/25/2008
- [cgal-discuss] Determining if the intersection between two planes is convex, Amir Vaxman, 08/25/2008
- Re: [cgal-discuss] Determining if the intersection between two planes is convex, Mathieu Brédif, 08/26/2008
- RE: [cgal-discuss] Determining if the intersection between two planes is convex, Amir Vaxman, 08/26/2008
- Re: [cgal-discuss] Determining if the intersection between two planes is convex, Mathieu Brédif, 08/26/2008
- Re: [?? Probable Spam] [cgal-discuss] Calculate angle, Max, 08/26/2008
- [cgal-discuss] Determining if the intersection between two planes is convex, Amir Vaxman, 08/25/2008
Archive powered by MHonArc 2.6.16.