; docformat = 'rst' ;+ ;Construct a quaternion from an axis and angle returns a 4-element array with ;the vector part of the quaternion first, followed by the scalar part, to ;correspond to the quaternion library. ; ; :Examples: ; quaternion = axis_angle_to_quat(axis, angle) ;- ;+ ; :Params: ; axis : in, required, type=int or double vector of int or double ; The axis that will be used to construct the quaternion. ; angle : in, required, type=int or double ; The angle from the axis used to construct the quaternion. ; ; :Returns: ; Returns a 4-element array with the vector part of the quaternion first, ; followed by the scalar part, to correspond to the quaternion library. ;- function axis_angle_to_quat,axis,angle if (~real_numeric_type(axis) or ~real_numeric_type(angle)) then begin doc_library, 'axis_angle_to_quat' return, -1 endif return,[sin(angle/2.0)*axis,cos(angle/2.0)] end