What is the calculation for the angle formed by the rotated x-axis in a 3D plot?

  • Thread starter irishetalon00
  • Start date
  • Tags
    Rotation
In summary, the conversation discussed how to calculate the angle formed by the x-axis after rotating the viewpoint in a 3D plot in MATLAB. The steps involved using rotation matrices and the angle was calculated to be -2.134 degrees, which matched the measured angle of the axis. A discrepancy was initially found due to unequal axes in MATLAB, but was resolved by setting the axes to be equal.
  • #1
irishetalon00
18
0

Homework Statement


I am working in Matlab, and have a 3D plot that I made:
ATTACH]

mkx2mt.png

IKX0GUG.png
x is parallel to axis labeled "lateral direction (m)"
y is parallel to axis labeled "long. dir. (m)"
z is normal to these (right hand coordinate sytem)

The original view was looking parallel with +y. To get the current view, I rotated our viewpoint about the x-axis -15 degrees, then rotated about the ORIGINAL z axis 10 degrees.

How do I calculate the angle that the x-axis now forms on the page?

For comparison, I used image editing software to measure the angle of the axis. It is a rectangle 12 high, 322 wide, so the angle is -2.134 deg.

Homework Equations

The Attempt at a Solution


I attempted to do rotation matrices. I did:
phi = -15deg
theta = 10deg

A =
[cos(theta) sin(theta) 0;
-sin(theta) cos(theta) 0;
0 0 1]

B =
[1 0 0;
0 cos(phi) -sin(phi);
0 sin(phi) cos(phi)]

B*A =
[ cos(theta), cos(phi)*sin(theta), -sin(phi)*sin(theta);
[ -sin(theta), cos(phi)*cos(theta), -cos(theta)*sin(phi);
[ 0, sin(phi), cos(phi)]

And do get the angle that the original x-axis forms with our new viewpoint, I do

r =
[1;
0;
0]

then do:
B*A*r

and I get:
[cos(theta);
-sin(theta);
0]

Which does not give me a correct result. Not only that, there is no way that a rotation in two different axes does not depend on both theta and phi.
 

Attachments

  • mkx2mt.png
    mkx2mt.png
    20.1 KB · Views: 176
Last edited:
Physics news on Phys.org
  • #2
I made a mental faux pas. The reason for the discrepancy is that the axes in MATLAB are not equal by default. Once I set the axes to be equal, my calculated angle matches the measured axis angle.
 

1) What is the rotation of a viewpoint?

The rotation of a viewpoint refers to the change in perspective or orientation of a viewer or observer. It can be applied to various fields such as photography, computer graphics, and astronomy.

2) How is the rotation of a viewpoint measured?

The rotation of a viewpoint is typically measured in degrees or radians, depending on the system being used. It can be measured in relation to a fixed point or axis, and can also be described using the three axes of rotation (x, y, z) in 3D space.

3) What is the importance of understanding rotation of a viewpoint in computer graphics?

In computer graphics, understanding the rotation of a viewpoint is essential for creating realistic and dynamic images. By manipulating the viewpoint, the appearance and perspective of objects in a scene can be changed, allowing for more visually interesting and accurate renderings.

4) How does rotation of a viewpoint affect the perception of depth in an image?

The rotation of a viewpoint can greatly impact the perception of depth in an image. By changing the viewpoint, objects can appear closer or farther away, and their size and shape can also be altered. This can create a sense of depth and dimension in an image.

5) Are there any limitations to the rotation of a viewpoint in computer graphics?

Yes, there are limitations to the rotation of a viewpoint in computer graphics. Depending on the software and hardware being used, there may be a limit to the number of degrees or axes of rotation that can be applied. Additionally, excessive or incorrect use of viewpoint rotation can lead to distorted or unrealistic images.

Similar threads

  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
819
  • Calculus and Beyond Homework Help
Replies
3
Views
783
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
Replies
2
Views
975
  • Precalculus Mathematics Homework Help
Replies
31
Views
2K
  • High Energy, Nuclear, Particle Physics
Replies
1
Views
63
  • Special and General Relativity
Replies
4
Views
766
  • Advanced Physics Homework Help
Replies
4
Views
416
Replies
9
Views
1K
Back
Top