quat_conjugate Function

public pure function quat_conjugate(q) result(c)

The conjugate of q: the inverse rotation, for a unit quaternion.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: q(4)

quaternion [x, y, z, w]

Return Value real(kind=wp), (4)


Source Code

    pure function quat_conjugate(q) result(c)
        real(wp), intent(in) :: q(4)                    !! quaternion [x, y, z, w]
        real(wp) :: c(4)
        c = [-q(1:3), q(4)]
    end function quat_conjugate