Results 1 to 6 of 6

Math Help - 3D vector problem

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    16

    3D vector problem

    I've got this problem where I want to convert a vector (X,Y,Z) to an angle (Pitch, Yaw, Roll) in degrees (radians is also fine).
    I've searched the internet but all examples I find are either in 2D or they just return one angle (the angle between two vectors or similar).

    The vector is representing the direction of an object (the forward vector).
    Things I have to go with: forward vector, right vector, up vector, rotation matrix, the rotation in quaternions.

    Can't use the quaternions since I actually need the degrees (or radians).
    Have also tried to find a way to convert quaternions to radians but I never found a working example.

    This is applied for a computer game I am working on for school, basically I need some theory.

    Any help would be much appreciated!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    10,970
    Thanks
    1011
    A vector is not an angle, an angle would be formed by two vectors, or an angle could be made between a vector and an axis. As it is, your question makes no sense.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor

    Joined
    Mar 2011
    From
    Tejas
    Posts
    3,154
    Thanks
    595
    there will actually be 3 angles, hmm? the problem with answering your question (which is perfectly decideable) is that there are competing conventions with notating and describing angular motion in 3 dimensions:

    Euler angles
    Tait-Bryan angles (this may be what you are wanting)
    Aircraft principal axes (this also may be what you are wanting)

    Euler angles are often computed using quaternions, as implementing Euler angles in programming can result in "gimbal lock" where one degree of freedom becomes permanently lost. quaternions avoid this problem.

    You may find what you are looking for here.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor

    Joined
    Mar 2011
    From
    Tejas
    Posts
    3,154
    Thanks
    595
    ProveIt, 3 dimensions is a special case: an angle occurs in a plane determined by 2 vectors. 3-dimensional space may be parametrized by 3 planes, as well as by 3 lines (the usual approach):

    namely, the direction in the xy, yz and zx planes.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Oct 2009
    Posts
    16
    Oops yes, that is perfectly right. Reading my question again that seems a bit odd.

    I just need some way to figure out the angles pitch, yaw and roll with the information I have.

    Thought it would be possible to convert a single vector into an angle since I've seen it been done in programming before I've just not be able to see the source code.
    One interesting thing about that programming function might be that the
    roll of the returned angle will always be zero. This is because the roll describes the rotation around the axis - the vector is just an axis. Maybe there is a trick to it.

    For example would it be possible to calculate pitch, yaw and roll if I calculated the angle between the forward vector and (1,0,0), forward and (0,1,0), forward and (0,0,1)?
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Oct 2009
    Posts
    16
    It's Euler angles.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Vector Problem
    Posted in the Math Topics Forum
    Replies: 3
    Last Post: November 7th 2010, 10:57 AM
  2. [SOLVED] Vector problem
    Posted in the Calculus Forum
    Replies: 1
    Last Post: October 3rd 2010, 03:03 PM
  3. 3D vector problem
    Posted in the Calculus Forum
    Replies: 1
    Last Post: May 7th 2010, 08:22 PM
  4. Vector problem
    Posted in the Algebra Forum
    Replies: 6
    Last Post: January 22nd 2010, 12:28 AM
  5. vector problem
    Posted in the Calculus Forum
    Replies: 2
    Last Post: January 8th 2010, 05:18 PM

Search Tags


/mathhelpforum @mathhelpforum