Click or drag to resize
DigitalRuneQuaternionDCreateRotation Method (Vector3D, Double)
Creates a unit quaternion that specifies a rotation given by axis and angle.

Namespace: DigitalRune.Mathematics.Algebra
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public static QuaternionD CreateRotation(
	Vector3D axis,
	double angle
)

Parameters

axis
Type: DigitalRune.Mathematics.AlgebraVector3D
The axis. (Vector does not need to be normalized.)
angle
Type: SystemDouble
The angle.

Return Value

Type: QuaternionD

The created unit quaternion that describes a rotation by the angle radians around the axis. (axis will be normalized automatically.)

The resulting quaternion is: q = (cos(θ/2), vsin(θ/2))

q = (cos(θ/2), vsin(θ/2))

where θ is the angle and v is the normalized axis.
Exceptions
ExceptionCondition
ArgumentException The axis vector has 0 length.
See Also