Skip to main content
Version: bleeding-edge 🩸

🔢 Quat

Floating point Quaternion that can represent a rotation about an axis in 3-D space

👐Open Source
This library implementation is Open Sourced on GitHub!
🧑‍💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!

🎒 Examples

local new_quaternion = Quat(0.5, 0.5, 1, -1)
local rotation = new_quaterion:Rotator()

🛠 Constructors

Default Constructor

local my_quat = Quat(X?, Y?, Z?, W?)
numberX0The quaternion's X-component
numberYXThe quaternion's Y-component
numberZXThe quaternion's Z-component
numberWXThe quaternion's W-component

🧽 Properties

numberXThe quaternion's X-component
numberYThe quaternion's Y-component
numberZThe quaternion's Z-component
numberWThe quaternion's W-component

🦠 Functions


This structure supports *, +, - and tostring operations.

NormalizeIn place normalize this Quaternion
RotatorRotatorGet the Rotator representation of this Quaternion
QuatInverseReturns the inverse of this Quaternion


In place normalize this Quaternion



Get the Rotator representation of this Quaternion

— Returns Rotator (Rotator representation of this Quaternion).

local ret = my_quat:Rotator()


Returns the inverse of this Quaternion

— Returns Quat (Inverse of this Quaternion).

local ret = my_quat:Inverse()