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.