I'm trying to find the pose of an 3D vector in terms of RPY. Let's say the two end points of the vector is P0(x0, y0, z0) and P1(x1, y1, z1). So the centered vector I get is V(Vx, Vy, Vz) = P1 - P0 = (x1 - x0, y1 - y0, z1 - z0)


 cos(alpha) = Vx/|V|
 cos(beta) = Vy/|V|
 cos(gamma) = Vz/|V|


  alpha = cos^-1(Vx/|V|)
  beta = cos^-1(Vy/|V|)
  gamma = cos^-1(Vz/|V|)

Here, I'm assuming alpha = roll, beta = pitch, and gamma = yaw

Is it the correct way to calculate RPY from a 3D vector?

Note: I know this question is more suited for math.stackexchange but assuming more developers probably have gone through this, I'm posting it here.

  • $\begingroup$ Your pose is not well defined, because you can still rotate any arbitrary amount around the vector you gave, so there will be infinitely many RPY representations which you could use. $\endgroup$
    – fibonatic
    May 28 '19 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.