ToAxisAngle() public method

Returns the axis angle representation in a Vector4. The x, y and z componentes are the axis and w is the angle.
public ToAxisAngle ( ) : Vector4
return Vector4
Example #1
0
        public void ToAxisAngle()
        {
            Vector3 rotationAxis = Vector3.ZAxis;
            var angle = Constants.HALF_PI;

            var quaternion = new Quaternion(rotationAxis, angle);

            Vector4 axisAngle = quaternion.ToAxisAngle();

            axisAngle.X.ShouldEqual(rotationAxis.X);
            axisAngle.Y.ShouldEqual(rotationAxis.Y);
            axisAngle.Z.ShouldEqual(rotationAxis.Z);
            axisAngle.W.ShouldEqual(angle);
        }