Finding Polar & Azimuthal Angles of 3D Vector

  • Thread starter Thread starter susantha
  • Start date Start date
  • Tags Tags
    3d Angles Vector
AI Thread Summary
To find the polar angle (θ) and azimuthal angle (φ) of a 3D vector defined by points A(x1, y1, z1) and B(x2, y2, z2), first calculate the vector AB by subtracting the coordinates. The magnitude of vector AB is determined using the formula r = sqrt(del_x^2 + del_y^2 + del_z^2). The polar angle θ is found using θ = arccos(del_z / r), while the azimuthal angle φ is calculated based on the signs of del_x and del_y to ensure it falls within the correct range. This method provides a systematic approach to determine the angles for any given 3D vector.
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
 
Consider an extremely long and perfectly calibrated scale. A car with a mass of 1000 kg is placed on it, and the scale registers this weight accurately. Now, suppose the car begins to move, reaching very high speeds. Neglecting air resistance and rolling friction, if the car attains, for example, a velocity of 500 km/h, will the scale still indicate a weight corresponding to 1000 kg, or will the measured value decrease as a result of the motion? In a second scenario, imagine a person with a...
Scalar and vector potentials in Coulomb gauge Assume Coulomb gauge so that $$\nabla \cdot \mathbf{A}=0.\tag{1}$$ The scalar potential ##\phi## is described by Poisson's equation $$\nabla^2 \phi = -\frac{\rho}{\varepsilon_0}\tag{2}$$ which has the instantaneous general solution given by $$\phi(\mathbf{r},t)=\frac{1}{4\pi\varepsilon_0}\int \frac{\rho(\mathbf{r}',t)}{|\mathbf{r}-\mathbf{r}'|}d^3r'.\tag{3}$$ In Coulomb gauge the vector potential ##\mathbf{A}## is given by...
Thread 'Griffith, Electrodynamics, 4th Edition, Example 4.8. (First part)'
I am reading the Griffith, Electrodynamics book, 4th edition, Example 4.8 and stuck at some statements. It's little bit confused. > Example 4.8. Suppose the entire region below the plane ##z=0## in Fig. 4.28 is filled with uniform linear dielectric material of susceptibility ##\chi_e##. Calculate the force on a point charge ##q## situated a distance ##d## above the origin. Solution : The surface bound charge on the ##xy## plane is of opposite sign to ##q##, so the force will be...

Similar threads

Back
Top