| QuaternionDCreateRotation Method (Vector3D, Vector3D) |
Creates a unit quaternion that specifies a rotation given by two vectors.
Namespace: DigitalRune.Mathematics.AlgebraAssembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax public static QuaternionD CreateRotation(
Vector3D startVector,
Vector3D rotatedVector
)
Public Shared Function CreateRotation (
startVector As Vector3D,
rotatedVector As Vector3D
) As QuaternionD
public:
static QuaternionD CreateRotation(
Vector3D startVector,
Vector3D rotatedVector
)
static member CreateRotation :
startVector : Vector3D *
rotatedVector : Vector3D -> QuaternionD
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 Exception | Condition |
---|
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