| QuaternionFCreateRotation Method (Vector3F, Vector3F) |
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 QuaternionF CreateRotation(
Vector3F startVector,
Vector3F rotatedVector
)
Public Shared Function CreateRotation (
startVector As Vector3F,
rotatedVector As Vector3F
) As QuaternionF
public:
static QuaternionF CreateRotation(
Vector3F startVector,
Vector3F rotatedVector
)
static member CreateRotation :
startVector : Vector3F *
rotatedVector : Vector3F -> QuaternionF
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 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