Finding Polar & Azimuthal Angles of 3D Vector

  • Context: Undergrad 
  • Thread starter Thread starter susantha
  • Start date Start date
  • Tags Tags
    3d Angles Vector
Click For Summary

Discussion Overview

The discussion revolves around finding the polar angle and azimuthal angle of a 3D vector defined by two points A(x1,y1,z1) and B(x2,y2,z2). Participants explore methods for calculating these angles, including the use of vector components and trigonometric relationships.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • One participant suggests dropping a perpendicular from the vector to the xy-plane to find the polar angle (θ) and using the planar polar coordinate for the azimuthal angle (φ).
  • Another participant describes calculating the vector from A to B by subtracting coordinates and finding the unit vector to derive direction cosines, relating these to the angles with the x, y, and z axes.
  • A participant provides an algorithm for calculating the polar angle (θ) using the arccosine function and the azimuthal angle (φ) using the arcsine function, including conditions to ensure φ is within the correct range.

Areas of Agreement / Disagreement

Participants generally agree on the methods for calculating the angles, but there are variations in terminology and the specific approach to determining the azimuthal angle. No consensus on a single method is established.

Contextual Notes

Some assumptions about the coordinate system and angle definitions may not be explicitly stated, and the discussion does not resolve potential ambiguities in the definitions of polar and azimuthal angles.

susantha
Messages
6
Reaction score
0
Hi,
Can anybody help me to find the polar angle and the azimuthal angle of a given 3D vector? Say we know the ordinates of the two point A(x1,y1,z1) and B(x2,y2,z2). So the question is find angles (Theta and Phi) of the vector AB. Any suggestion would be really appreciated.

Thanks.
Susantha
 
Physics news on Phys.org
welcome to pf!

hi susantha! welcome to pf! :smile:

(have a theta: θ and a phi: φ and try using the X2 icon just above the Reply box :wink:)

drop a perpendicular from (x,y,z) to the x,y plane … that gives you tanθ, then φ wil be the usual planar polar coordinate :wink:
 
You can, of course, calculate the vector from A to B just by subtracting coordinates. You can then calculate the unit vector by dividing each component by the length of the vector.

And the components of that unit vector are the "direction cosines". That is, if the unit vector is a\vec{i}+ b\vec{j}+ c\vec{k} and the angle the vector makes with the x-axis is \theta, the angle the vector makes with the y-axis is \phi, and the angle the vector makes with the z-axis is \psi, then

a= cos(\theta),
b= cos(\phi),
and
c= cos(\psi)

Of course, those angles are not independent: cos^2(\theta)+ cos^2(\phi)+ cos^2(\psi)= 1 so it is sufficient to know two.

If I understand you correctly, the "polar angle" is \theta and the "azimuthal angle" is \psi.
 
Thank you for your valuable comments. Now I guess I have the algorithm to find two angles (teta and phi) of a given 3d vector. Here is the algorithm:

// First find the vector AB. (vector AB= vector B - vector A). B=(x1,y1,z1) and A=(x2,y2,z2)
// vector AB =(del_x, del_y, del_z);
del_x = x1-x2;
del_y = y1-y2;
del_z = z1-z2;
// Then we can find the magnitude of the vector AB,
r=sqrt (del_x^2 + del_y^2 +del_z^2);
s = sqrt ( del_x^2 + del_y^2 );
teta = arccos(del_z / r); // teta is the polar angle

//to find the azimuth angle,
if (del_x > 0)
phi= arcsin( del_y / s);
else
phi=pi - arcsin( del_y / s);

if (del_x > 0 && del_y <0 )
phi= pi - phi;

The last if condition is to make sure the phi has positive values between zero and 2*pi.

Thanks again for all comments.
Susantha
 

Similar threads

  • · Replies 21 ·
Replies
21
Views
2K
Replies
17
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 17 ·
Replies
17
Views
5K