Quaternion

Describes rotation in 3D

Constructors

this
this()

Default constructor. Angle = 0. Or 2pi*n, as you wish

this
this(double angle, Vector axis)

Construct by angle and axis-Vector. Axis-Vector will be normalized, so don't worry about length

this
this(double angle, double _x, double _y, double _z)

Construct by angle and axis' coordinates. Axis-Vector will be normalized, so don't worry about length

Members

Functions

opBinary
Quaternion opBinary(Quaternion q)

Quaternion multiplication. Ex: b*a describes sequence of rotations - <b> first a, when b </b>. Yes, in <b> reverse-order </b>

Properties

axis
Vector axis [@property getter]

Get axis-vector

axis
Vector axis [@property setter]

Set axis-vector

c
double c [@property getter]

Get cos(alpha/2), where alpha - rotation angle

c
double c [@property setter]

Set cos(alpha/2), where alpha - rotation angle

s
double s [@property getter]

Get sin(alpha/2), where alpha - rotation angle

s
double s [@property setter]

Set sin(alpha/2), where alpha - rotation angle

x
double x [@property getter]

Get x

x
double x [@property setter]

Set x

y
double y [@property getter]

Get y

y
double y [@property setter]

Set y

z
double z [@property getter]

Get z

z
double z [@property setter]

Set z

Meta