I have two vectors in 3D space and I want the angle to be in -pi,pi. Hence intend to use atan2 in place of acos function. It will be a great help, if some body can guide me.
Hi, atan2(y,x) determine the angle between the positive x axis and tha point (x,y) un R2. Thus it is not useful for determining an angle between two vectors in 3D.
The cos of the angle in 3D is given by the dot product between the two vectors divided by the product of the norms of these vectors.