rpy_to_rot Subroutine

private pure subroutine rpy_to_rot(roll, pitch, yaw, r)

Roll, pitch and yaw (rad) to the rotation matrix (as in moonframe).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: roll
real(kind=wp), intent(in) :: pitch
real(kind=wp), intent(in) :: yaw
real(kind=wp), intent(out), dimension(3,3) :: r

Called by

proc~~rpy_to_rot~~CalledByGraph proc~rpy_to_rot rpy_to_rot proc~j2000_to_frame moon_pa_frame%j2000_to_frame proc~j2000_to_frame->proc~rpy_to_rot proc~frame_to_j2000 moon_pa_frame%frame_to_j2000 proc~frame_to_j2000->proc~j2000_to_frame

Source Code

    pure subroutine rpy_to_rot(roll, pitch, yaw, r)

    real(wp),intent(in)  :: roll, pitch, yaw
    real(wp),dimension(3,3),intent(out) :: r

    real(wp) :: cr, sr, cp, sp, cy, sy

    cr = cos(roll)
    sr = sin(roll)
    cp = cos(pitch)
    sp = sin(pitch)
    cy = cos(yaw)
    sy = sin(yaw)

    r(1,1) = cy*cp
    r(1,2) = cy*sp*sr - sy*cr
    r(1,3) = cy*sp*cr + sy*sr
    r(2,1) = sy*cp
    r(2,2) = sy*sp*sr + cy*cr
    r(2,3) = sy*sp*cr - cy*sr
    r(3,1) = -sp
    r(3,2) = cp*sr
    r(3,3) = cp*cr

    end subroutine rpy_to_rot