Click or drag to resize
DigitalRuneQuaternionDCreateRotation Method (Vector3D, Vector3D)
Creates a unit quaternion that specifies a rotation given by two vectors.

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 startVector,
	Vector3D rotatedVector
)

Parameters

startVector
Type: DigitalRune.Mathematics.AlgebraVector3D
The initial vector. (Vector does not need to be normalized.)
rotatedVector
Type: DigitalRune.Mathematics.AlgebraVector3D
The rotated vector. (Vector does not need to be normalized.)

Return Value

Type: QuaternionD
The created unit quaternion that would rotate startVector to rotatedVector.
Exceptions
ExceptionCondition
ArgumentException The length of the startVector and rotatedVector must not be 0.
Remarks
The quaternion is set to a rotation that would rotate vector startVector to the orientation of vector rotatedVector.
See Also