src/quaternim

Procs

proc `$`(q: Quaternion): string {....raises: [ValueError], tags: [].}
Algebraic representation in the form of r + (ci)i + (cj)j + (ck)k
proc `*`(q1: Quaternion; q2: Quaternion): Quaternion {....raises: [], tags: [].}
Hamilton Product of q1 and q2
proc `*`(q: Quaternion; s: float): Quaternion {....raises: [], tags: [].}
Right scalar multiplication of q by s
proc `*`(s: float; q: Quaternion): Quaternion {....raises: [], tags: [].}
Left scalar multiplication of s by q
proc `+`(q1: Quaternion; q2: Quaternion): Quaternion {....raises: [], tags: [].}
Addition of two quaternions
proc `-`(q1: Quaternion; q2: Quaternion): Quaternion {....raises: [], tags: [].}
Subtraction of a quaternion form another
proc `/`(q: Quaternion; s: float): Quaternion {....raises: [QDivByZeroDefect],
    tags: [].}
Right scalar division of q by non-zero s
proc `==`(q1: Quaternion; q2: Quaternion): bool {....raises: [], tags: [].}
True if q1 and q2 are the same quaternion
proc conj(q: Quaternion): Quaternion {....raises: [], tags: [].}
Complex Conjugate of q
proc initQuaternion(r: float; ci: float; cj: float; ck: float): Quaternion {.
    ...raises: [], tags: [].}
Initializes quaternion r + ci*j + cj*j + ck*k
proc inverse(q: Quaternion): Quaternion {....raises: [QDivByZeroDefect], tags: [].}
Inverse of q
proc is_identity(q: Quaternion): bool {....raises: [], tags: [].}
True if q is the multiplicative identity quaternion
proc is_scalar(q: Quaternion): bool {....raises: [], tags: [].}
True if q is a scalar quaternion
proc is_unit(q: Quaternion): bool {....raises: [], tags: [].}
True if q has norm 1, i.e. is the unit quaternion
proc is_unit(q: UnitQuaternion): bool {....raises: [], tags: [].}
True if q is type UnitQuaternion
proc is_vector(q: Quaternion): bool {....raises: [], tags: [].}
True if q is a vector quaternion
proc is_zero(q: Quaternion): bool {....raises: [], tags: [].}
True if q is the zero quaternion
proc norm(q: Quaternion): float {....raises: [], tags: [].}
Norm of q
proc real(q: Quaternion): float {....raises: [], tags: [].}
Gets the real part of the quaternion
proc rotateVector(rq: RotationQuaternion; x: float; y: float; z: float): tuple[
    x: float, y: float, z: float] {....raises: [], tags: [].}
proc rotationQuaternion(yaw: float; pitch: float; roll: float): RotationQuaternion {.
    ...raises: [], tags: [].}
proc scalarToQuaternion(s: float): Quaternion {....raises: [], tags: [].}
Creates a scalar quaternion from s
proc unit(q: Quaternion): Quaternion {....raises: [QDivByZeroDefect], tags: [].}
Get Unit Quaternion from q
proc vector(q: Quaternion): (float, float, float) {....raises: [], tags: [].}
Gets the vector part of the quaternion