angle between 2 vectors ..

I was searching for a parameterized equation for elliptical arcs and .. quite happy to find it in a useful form in the spec (Appendix F.6 Eq. F.6.3.1).

On the next page there I became aware of a formula to determine the angle between two vectors u and v (F.6.5.4).
To implement this we need 4 calls of math functions: 
1 x acos()
2 x abs()
1 x sign()

I usually implement this in a somewhat other way, via

teta = atan2(ux*vy - uy*vx, ux*vx + uy*vy);

wich yields a teta in the range of  -pi/2 < teta < pi/2

with no need to care for the sign or any other pre- or postcalculations and one single math function.

are there any arguments against that ?

--
stefan goessner

Received on Friday, 27 April 2001 08:36:07 UTC