Skip to main content

Quater

Code Example​

::STAR::Quater a( 0, 1, 0, 0 );

::STAR::Quater b(); // will be initialised to( 0, 0, 0, 0 )

::STAR::Quater c = a + b;

Constructor​

Quater quater(Scalar x, Scalar y, Scalar z)

Quater quater(Quater q)
  • x - the x value of this quater. Default is 0
  • y - the y value of this quater. Default is 0
  • z - the z value of this quater. Default is 0
  • w - the w value of this quater. Default is 0

Methods​

Basic Properties Methods​

Basic Operations

PropertiesDescription
.[0]: ScalarReturns a the value x of this quater.
.[1]: ScalarReturns a the value y of this quater.
.[2]: ScalarReturns a the value z of this quater.
.[3]: ScalarReturns a the value w of this quater.

Basic Getter Methods

PropertiesDescription
.x(): ScalarReturns a the value x of this quater.
.y(): ScalarReturns a the value x of this quater.
.z(): ScalarReturns a the value x of this quater.
.w(): ScalarReturns a the value w of this quater.
.print(): void

Basic Setter Methods

PropertiesDescription
.set(Scalar s): thisCopies the value to this Quater x, y, z, w.
.set(Quater q): thisCopies the values of x, y, z, w to this Quater.
.setX(Scalar s): thisCopies the value of x to this Quater.
.setY(Scalar s): thisCopies the value of y to this Quater.
.setZ(Scalar s): thisCopies the value of z to this Quater.
.setW(Scalar s): thisCopies the value of w to this Quater.

Basic Math Methods​

Basic Operations

PropertiesDescription
+(): Quater
-(): Quater
+(Scalar s): Quater
-(Scalar s): Quater
*(Scalar s): Quater
/(Scalar s): Quater
+(Quater q): QuaterCalculates the add product of this quater and q.
-(Quater q): QuaterCalculates the sub product of this quater and q.

Basic Calculations

PropertiesDescription
.dot(Quater q): ScalarCalculates the dot product of this quater and q.
.length(): ScalarCalculates the Euclidean length from(0, 0) to(x, y, z).