Method

NumCosmoMathQuaternionset_to_rotate_to_z

Declaration [src]

void
ncm_quaternion_set_to_rotate_to_z (
  NcmQuaternion* q,
  NcmTriVec* v
)

Description [src]

Sets q to the rotation that rotates the given NcmTriVec to the z-axis. It finds first the quaternion that rotates the given vector to the xz-plane and then the quaternion that rotates the vector to the z-axis. Finally, it multiplies the two quaternions and stores the result in q.

Parameters

v

Type: NcmTriVec

A NcmTriVec.

The data is owned by the caller of the method.