Quaternion notation of Vector3D
The [Help] of the Vecror3D.w property mentions about the quaternion notation as follows:
Quaternion notation employs an angle as the fourth element in its calculation of three-dimensional rotation. The w property can be used to define the angle of rotation about the Vector3D object.
But this sounds like explanation of the axis angle (see Orientation3D .AXIS_ANGLE Constant). The axis angle uses a combination of an axis and an angle to determine the rotation. For an argument of the Matrix3D.decompose() or Matrix3D.recompose() method Orientation3D.AXIS_ANGLE can be specified as the orientation style used for the matrix transformation.
Try to rotate a Matrix3D object 180 degrees (π) around the axis (1/√2, 1/√2, 0).

var myMatrix3D:Matrix3D = new Matrix3D(); var axis:Vector3D = new Vector3D(Math.SQRT1_2, Math.SQRT1_2,0); myMatrix3D.prependRotation(180, axis); var axisAngle:Vector3D = myMatrix3D.decompose(Orientation3D.AXIS_ANGLE)[1]; trace(axisAngle, axisAngle.w);
The frame action above outputs as follows:
Vector3D(0.7071067094802856, 0.7071068286895752, -2.339619844353034e-24) 3.1415927410125732
[Note]: 0.707… = 1/√2 and 3.14… = π radians = 180 degrees.
The (x, y, z) coordinates represents the axis and Vector3D.w property is an angle of the rotation. This result seems to fit the explanation of the [Help] quoted above.
But the quaternion notation determine the rotation by the four value. The following expression of the quaternion Q represents the rotation of θ around the vector U.
U = (x, y, z) and |U| = 1
Q = (cos(θ/2); sin(θ/2)U)
Then try to rotate a Matrix3D object 60 degrees around the y axis (0, 1, 0).
var myMatrix3D:Matrix3D = new Matrix3D(); myMatrix3D.prependRotation(60, Vector3D.Y_AXIS); var quaternion:Vector3D = myMatrix3D.decompose(Orientation3D.QUATERNION)[1]; trace(quaternion.w, quaternion);
The frame action above outputs as follows:
0.8660253882408142 Vector3D(0, 0.4999999701976776, 0)
These numbers represent the quaternion of 60 degrees’ rotation.
0.866… = cos(60/2) = cos(30)
(0, 0.5, 0) = sin(60/2) (0, 1, 0)