Skip to Content.
Sympa Menu

cgal-discuss - Angle between vectors

Subject: CGAL users discussion list

List archive

Angle between vectors


Chronological Thread 
  • From: "Tardugno, Angelo" <>
  • To: <>
  • Subject: Angle between vectors
  • Date: Mon, 4 Jun 2007 16:12:11 +0100

Hi all,
I need to compute the angle between two vectors. I've got two Vector_3 objects and I was thinking to compute their dot product and then divide this by the product of the magnitude of the two vectors. The problem is that I can't evaluate the sqrt of the sum of the squared components of the vectors. Is there an in-built function that computes the magnitude of a vector.
 
Another possibility would be using Direction_3, but it seems that there is no dot product defined for this object.
Anyway, if I transform my vectors into Direction_3 objects and then I transform the Direction_3 objects into vector do I end up with unit vectors? In this case I could easily evaluate the dot product of these vectors and I have solved my problems.
Thank You
Angelo



Archive powered by MHonArc 2.6.16.

Top of Page