Home Examples Installation Documentation Contact Help

rotate

Specification

Location Author Maintained by
isl/math/quaternion.py Kenny Erleben DIKU

Purpose & Params

Given and a unit quaternion , then the rotation of p is given by

the it represents a rotation of radians around the axis n

Example

    r      = np.array([1,0,0])
    n      = np.array([0,1,0])
    radian = (0.5 * np.pi) / 2
    q      = np.array([np.cos(radian),n[0]*np.sin(radian),n[1]*np.sin(radian),n[2]*np.sin(radian)], dtype=np.float64)
    print(quat.rotate(q, r))

output:

   array([0.0,0.0,-1.0])