# spacepy.coordinates.quaternionRotateVector

spacepy.coordinates.quaternionRotateVector(Qin, Vin, scalarPos='last', normalize=True)

  Given quaternions and vectors, return the vectors rotated by the quaternions

  Parameters
    Qin array_like

      input quaternion to rotate by

    Vin array-like

      input vector to rotate

  Returns
    out array_like

      rotated vector

  See also

  `quaternionMultiply`

  Examples

      >>> import spacepy.coordinates
      >>> import numpy as np
      >>> vec = [1, 0, 0]
      >>> quat_wijk = [np.sin(np.pi/4), 0, np.sin(np.pi/4), 0.0]
      >>> quat_ijkw = [0.0, np.sin(np.pi/4), 0, np.sin(np.pi/4)]
      >>> spacepy.coordinates.quaternionRotateVector(quat_ijkw, vec)
      array([ 0.,  0., -1.])
      >>> spacepy.coordinates.quaternionRotateVector(
      ...     quat_wijk, vec, scalarPos='first')
      array([ 0.,  0., -1.])