Click or drag to resize
DigitalRuneQuaternionFCreateRotation Method (Vector3F, Vector3F)
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 QuaternionF CreateRotation(
	Vector3F startVector,
	Vector3F rotatedVector
)

Parameters

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

Return Value

Type: QuaternionF
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