Rotation matrix for azimuth and zenith angles

Click For Summary

Discussion Overview

The discussion revolves around the application of rotation matrices in the context of spherical coordinates, specifically focusing on how to rotate a shape defined by spherical coordinates (r, theta, phi) using azimuth and zenith angles. Participants explore the implications of incrementing these angles and converting to Cartesian coordinates.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant presents a rotation matrix for the azimuth angle and seeks guidance on deriving the rotation matrix for the zenith angle.
  • Another participant suggests that incrementing theta and phi directly and converting to Cartesian coordinates might be a straightforward approach.
  • A different participant argues that simply adding degrees to theta or phi does not yield the expected results when converting to Cartesian coordinates, stating it leads to incorrect values.
  • Another participant provides rotation equations within a Cartesian system and references the conversion formulas from spherical to Cartesian coordinates, indicating potential misunderstandings in the conversion process.
  • There is a suggestion that the increments in theta and phi correspond to specific rotations around the Y and Z axes, respectively.
  • One participant questions whether the original poster is trying to interpret mouse input in relation to the rotations.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness of incrementing theta and phi directly versus using rotation matrices, indicating that the discussion remains unresolved with multiple competing perspectives.

Contextual Notes

There are limitations regarding the assumptions made about the relationship between spherical and Cartesian coordinates, as well as the effects of incrementing angles on the resulting transformations. The discussion does not resolve these complexities.

lightningbolt
Messages
2
Reaction score
0
I have a shape with spherical coordinate (r, theta, phi) which I can convert to Cartesian. I want to apply rotation to the shape by incrementing theta & phi.
I figured out the matrix for rotating azimuth angle is
{
{cos(theta), -sin(theta), 0}
{sin(theta), cos(theta), 0}
{ 0, 0, 1}
}
How to find the rotation matrix for Zenith angle?.
Thanks.
 
Physics news on Phys.org
Why don't you increment θ and φ as you wish then convert to Cartesian?
 
@SonyAD,
If you change θ and φ in spherical coordinates and convert to Cartesian, it won't result in the change you expect. It gives garbage values.
i.e I can't just add 5 degree to θ or φ, if i want to rotate the shape 5 degree.
Thanks.
 
I don't think I understand what you're after.

If it is rotation equations inside a Cartesian system you're after:

v1 = calf*xi+salf*zi;
v2 = calf*zi-salf*xi;
v3 = cbet*yi+sbet*v2;

zr = cbet*v2-sbet*yi;
xr = cgam*v1+sgam*v3;
yr = cgam*v3-sgam*v1;

salf = \sin(\alpha);
calf = \cos(\alpha);
etc.

In case you're making a mistake converting to Cartesian, I've worked out how to do it and http://en.wikipedia.org/wiki/Spherical_coordinate_system#Cartesian_coordinates":

x = radius · sin(θ) · cos(φ)
y = radius · sin(θ) · sin(φ)
z = radius · cos(θ)

In case the spherical coordinate system isn't doing what you expect it to, when you increment θ and φ this is what actually happens:

You rotate the initial point around the absolute Y axis.
You rotate the transformed point around the absolute Z axis.

Are you trying to interpret mouse input?
 
Last edited by a moderator:

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 33 ·
2
Replies
33
Views
5K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 7 ·
Replies
7
Views
6K