jaxdem.utils.quaternion#

Utility functions to handle environments.

Classes

Quaternion(w, xyz)

Quaternion representing the orientation of a particle.

class jaxdem.utils.quaternion.Quaternion(w: Array, xyz: Array)[source]#

Bases: object

Quaternion representing the orientation of a particle. Stores the rotation body to lab.

w: Array#
xyz: Array#
static create(w: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None = None, xyz: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None = None) Quaternion[source][source]#
static unit(q: Quaternion) Quaternion[source][source]#
static conj(q: Quaternion) Quaternion[source][source]#
static inv(q: Quaternion) Quaternion[source][source]#
static rotate(q: Quaternion, v: Array) Array[source][source]#

Rotates a vector v from the body reference frame to the lab reference frame.

static rotate_back(q: Quaternion, v: Array) Array[source][source]#

Rotates a vector v from the lab reference frame to the body reference frame.