Library quaternion

Quaternion library

This library has been deprecated and will be removed in the future for the following reason: Pure Lua implementation. This can be done with a user library.

Functions

New (self, ...) Creates a new Quaternion given a variety of inputs
abs (q) Returns absolute value of
conj (q) Returns the conjugate of
exp (q) Raises Euler's constant e to the power
inv (q) Returns the inverse of
log (q) Calculates natural logarithm of
qMod (q) Changes quaternion so that the represented rotation is by an angle between 0 and 180 degrees (by coder0xff)
qRotation (rv1) Construct a quaternion from the rotation vector .
qRotation (rv1) Construct a quaternion from the rotation vector .
qi (n) Returns Quaternion *i
qj (n) Returns Quaternion *j
qk (n) Returns Quaternion *k
rotationAngle (q) Returns the angle of rotation in degrees (by coder0xff)
rotationAxis (q) Returns the axis of rotation (by coder0xff)
rotationVector (q) Returns the rotation vector - rotation axis where magnitude is the angle of rotation in degress (by coder0xff)
slerp (q0, q1, t) Performs spherical linear interpolation between and .
vec (q) Converts to a vector by dropping the real component


Functions

quat_lib.New (self, ...)
Creates a new Quaternion given a variety of inputs

Parameters:

  • self:
  • ...: A series of arguments which lead to valid generation of a quaternion. See argTypesToQuat table for examples of acceptable inputs.
quat_lib.abs (q)
Returns absolute value of

Parameters:

  • q:
quat_lib.conj (q)
Returns the conjugate of

Parameters:

  • q:
quat_lib.exp (q)
Raises Euler's constant e to the power

Parameters:

  • q:
quat_lib.inv (q)
Returns the inverse of

Parameters:

  • q:
quat_lib.log (q)
Calculates natural logarithm of

Parameters:

  • q:
quat_lib.qMod (q)
Changes quaternion so that the represented rotation is by an angle between 0 and 180 degrees (by coder0xff)

Parameters:

  • q:
quat_lib.qRotation (rv1)
Construct a quaternion from the rotation vector . Vector direction is axis of rotation, magnitude is angle in degress (by coder0xff)

Parameters:

  • rv1:
quat_lib.qRotation (rv1)
Construct a quaternion from the rotation vector . Vector direction is axis of rotation, magnitude is angle in degress (by coder0xff)

Parameters:

  • rv1:
quat_lib.qi (n)
Returns Quaternion *i

Parameters:

  • n:
quat_lib.qj (n)
Returns Quaternion *j

Parameters:

  • n:
quat_lib.qk (n)
Returns Quaternion *k

Parameters:

  • n:
quat_lib.rotationAngle (q)
Returns the angle of rotation in degrees (by coder0xff)

Parameters:

  • q:
quat_lib.rotationAxis (q)
Returns the axis of rotation (by coder0xff)

Parameters:

  • q:
quat_lib.rotationVector (q)
Returns the rotation vector - rotation axis where magnitude is the angle of rotation in degress (by coder0xff)

Parameters:

  • q:
quat_lib.slerp (q0, q1, t)
Performs spherical linear interpolation between and . Returns for =0, for =1

Parameters:

  • q0:
  • q1:
  • t:
quat_lib.vec (q)
Converts to a vector by dropping the real component

Parameters:

  • q:

Valid XHTML 1.0!