(point, quat)
return q_point_rotated[:3]
Performs a rotation by quaternion.

  Rotate the point by the quaternion using quaternion multiplication,
  (q * p * q^-1), without constructing the rotation matrix.

  Args:
    point: The point to be rotated.
    quat: The rotation represented as a quaternion [x, y, z, w].

  Returns:
    A 3D vector in a numpy array.
Performs a rotation by quaternion.
Performs a rotation by quaternion .
def QuaternionRotatePoint(point, quat):
  """Performs a rotation by quaternion.

  Rotate the point by the quaternion using quaternion multiplication,
  (q * p * q^-1), without constructing the rotation matrix.

  Args:
    point: The point to be rotated.
    quat: The rotation represented as a quaternion [x, y, z, w].

  Returns:
    A 3D vector in a numpy array.
  """

  q_point = np.array([point[0], point[1], point[2], 0.0])
  quat_inverse = transformations.quaternion_inverse(quat)
  q_point_rotated = transformations.quaternion_multiply(
      transformations.quaternion_multiply(quat, q_point), quat_inverse)
  return q_point_rotated[:3]
def QuaternionRotatePoint ( point , quat ) : q_point = np . array ( [ point [ 0 ] , point [ 1 ] , point [ 2 ] , 0.0 ] ) quat_inverse = transformations . quaternion_inverse ( quat ) q_point_rotated = transformations . quaternion_multiply ( transformations . quaternion_multiply ( quat , q_point ) , quat_inverse ) return q_point_rotated [ : 3 ]