siconos.geometry module

Siconos tools to deal with quaternions, rotations …

siconos.geometry.quaternionFromRotationVector(rotationVector: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[7, 1]']

Computes a quaternion from a rotation vector :param rotationVector: rotation (axis-angle) :type rotationVector: array-like

Returns:

numpy.ndarray of size 7

siconos.geometry.rewriteVectorFromAbsoluteToBodyFrame(q: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'], v: Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]', 'flags.writeable']) None

For a given configuration vector q composed of a position and a quaternion, express the vector v given in the inertial frame into to the body frame w.r.t the quaternion that parametrize the rotation in q.

Parameters:
  • q (array(7), [x,y,z,qw,qx,qy,qz])

  • v (array(3))

siconos.geometry.rewriteVectorFromBodyToAbsoluteFrame(q: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'], v: Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]', 'flags.writeable']) None

For a given configuration vector q composed of a position and a quaternion, write an input vector expressed in the inertial frame into to the body frame w.r.t the quaternion that parametrize the rotation in q. :param q: :type q: array(7), [x,y,z,qw,qx,qy,qz] :param v: :type v: array(3)

siconos.geometry.rotationVectorFromQuaternion(q0: SupportsFloat | SupportsIndex, q1: SupportsFloat | SupportsIndex, q2: SupportsFloat | SupportsIndex, q3: SupportsFloat | SupportsIndex) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']

Computes a quaternion from a rotation vector :param q0: :param q1: :param q2: :param q3 quaternion components:

Returns:

numpy.ndarray of size 3