Click or drag to resize
DigitalRuneQuaternionFCreateRotation Method (Vector3F, Single)
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 QuaternionF CreateRotation(
	Vector3F axis,
	float angle
)

Parameters

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

Return Value

Type: QuaternionF

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