Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 398607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:45:54+00:00 2026-05-12T16:45:54+00:00

I have pitch, roll, and yaw angles. How would I convert these to a

  • 0

I have pitch, roll, and yaw angles. How would I convert these to a directional vector?

It’d be especially cool if you can show me a quaternion and/or matrix representation of this!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:45:54+00:00Added an answer on May 12, 2026 at 4:45 pm

    Unfortunately there are different conventions on how to define these things (and roll, pitch, yaw are not quite the same as Euler angles), so you’ll have to be careful.

    If we define pitch=0 as horizontal (z=0) and yaw as counter-clockwise from the x axis, then the direction vector will be

    x = cos(yaw)*cos(pitch)
    y = sin(yaw)*cos(pitch)
    z = sin(pitch)
    

    Note that I haven’t used roll; this is direction unit vector, it doesn’t specify attitude. It’s easy enough to write a rotation matrix that will carry things into the frame of the flying object (if you want to know, say, where the left wing-tip is pointing), but it’s really a good idea to specify the conventions first. Can you tell us more about the problem?

    EDIT:
    (I’ve been meaning to get back to this question for two and a half years.)

    For the full rotation matrix, if we use the convention above and we want the vector to yaw first, then pitch, then roll, in order to get the final coordinates in the world coordinate frame we must apply the rotation matrices in the reverse order.

    First roll:

    | 1    0          0      |
    | 0 cos(roll) -sin(roll) |
    | 0 sin(roll)  cos(roll) |
    

    then pitch:

    | cos(pitch) 0 -sin(pitch) |
    |     0      1      0      |
    | sin(pitch) 0  cos(pitch) |
    

    then yaw:

    | cos(yaw) -sin(yaw) 0 |
    | sin(yaw)  cos(yaw) 0 |
    |    0         0     1 |
    

    Combine them, and the total rotation matrix is:

    | cos(yaw)cos(pitch) -cos(yaw)sin(pitch)sin(roll)-sin(yaw)cos(roll) -cos(yaw)sin(pitch)cos(roll)+sin(yaw)sin(roll)|
    | sin(yaw)cos(pitch) -sin(yaw)sin(pitch)sin(roll)+cos(yaw)cos(roll) -sin(yaw)sin(pitch)cos(roll)-cos(yaw)sin(roll)|
    | sin(pitch)          cos(pitch)sin(roll)                            cos(pitch)sin(roll)|
    

    So for a unit vector that starts at the x axis, the final coordinates will be:

    x = cos(yaw)cos(pitch)
    y = sin(yaw)cos(pitch)
    z = sin(pitch)
    

    And for the unit vector that starts at the y axis (the left wing-tip), the final coordinates will be:

    x = -cos(yaw)sin(pitch)sin(roll)-sin(yaw)cos(roll)
    y = -sin(yaw)sin(pitch)sin(roll)+cos(yaw)cos(roll)
    z =  cos(pitch)sin(roll)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three gyroscope values, pitch, roll and yaw. I would like to add
I have rotation values (roll, pitch, yaw). I would like to apply that rotation
I have yaw, pitch and roll from an object and i need to transform
I'm trying to find the yaw, pitch and roll angles of a camera, assuming
I am building an augmented reality application and I have the yaw, pitch, and
How can I increase/decrease (frequency/pitch) and phase using fft/ifft I think I have the
Let's say I have a class like: class NavigationData { float roll; float pitch;
I have an algorithm for converting between a Quaternion and Euler angles. public static
I have a direction vector that applied to a position gives me the point
How do I pitch a camera in localspace? I have a model that rotates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.