1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Rotation of a viewpoint

  1. Jul 14, 2017 #1
    1. The problem statement, all variables and given/known data
    I am working in Matlab, and have a 3D plot that I made:
    [​IMG]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.

    2. Relevant equations

    3. 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 =

    then do:

    and I get:

    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.
    Last edited: Jul 14, 2017
  2. jcsd
  3. Jul 14, 2017 #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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted