Quaternion Quaternion Quaternion Quaternion Struct

定義

表示用來編碼三維實體旋轉的向量。Represents a vector that is used to encode three-dimensional physical rotations.

public value class Quaternion : IEquatable<System::Numerics::Quaternion>
public struct Quaternion : IEquatable<System.Numerics.Quaternion>
type Quaternion = struct
Public Structure Quaternion
Implements IEquatable(Of Quaternion)
繼承
QuaternionQuaternionQuaternionQuaternion
實作

備註

Quaternion結構是用來以角度 theta 來有效率地將關於 (x, y, z) 向量的物件旋轉, 其中:The Quaternion structure is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where:

w = cos(theta/2)  

建構函式

Quaternion(Vector3, Single) Quaternion(Vector3, Single) Quaternion(Vector3, Single) Quaternion(Vector3, Single)

從指定的向量和旋轉部分建立四元數。Creates a quaternion from the specified vector and rotation parts.

Quaternion(Single, Single, Single, Single) Quaternion(Single, Single, Single, Single) Quaternion(Single, Single, Single, Single) Quaternion(Single, Single, Single, Single)

從指定的元件建構四元數。Constructs a quaternion from the specified components.

欄位

W W W W

四元數的旋轉元件。The rotation component of the quaternion.

X X X X

四元數之向量元件的 X 值。The X value of the vector component of the quaternion.

Y Y Y Y

四元數之向量元件的 Y 值。The Y value of the vector component of the quaternion.

Z Z Z Z

四元數之向量元件的 Z 值。The Z value of the vector component of the quaternion.

屬性

Identity Identity Identity Identity

取得表示沒有旋轉的四元數。Gets a quaternion that represents no rotation.

IsIdentity IsIdentity IsIdentity IsIdentity

取得值,這個值表示目前執行個體是否為單位四元數。Gets a value that indicates whether the current instance is the identity quaternion.

方法

Add(Quaternion, Quaternion) Add(Quaternion, Quaternion) Add(Quaternion, Quaternion) Add(Quaternion, Quaternion)

將一個四元數的每個元素和第二個四元數的相對應元素相加。Adds each element in one quaternion with its corresponding element in a second quaternion.

Concatenate(Quaternion, Quaternion) Concatenate(Quaternion, Quaternion) Concatenate(Quaternion, Quaternion) Concatenate(Quaternion, Quaternion)

串連兩個四元數。Concatenates two quaternions.

Conjugate(Quaternion) Conjugate(Quaternion) Conjugate(Quaternion) Conjugate(Quaternion)

傳回指定四元數的共軛。Returns the conjugate of a specified quaternion.

CreateFromAxisAngle(Vector3, Single) CreateFromAxisAngle(Vector3, Single) CreateFromAxisAngle(Vector3, Single) CreateFromAxisAngle(Vector3, Single)

從單位向量和對此向量旋轉的角度建立四元數。Creates a quaternion from a unit vector and an angle to rotate around the vector.

CreateFromRotationMatrix(Matrix4x4) CreateFromRotationMatrix(Matrix4x4) CreateFromRotationMatrix(Matrix4x4) CreateFromRotationMatrix(Matrix4x4)

從指定的旋轉矩陣建立四元數。Creates a quaternion from the specified rotation matrix.

CreateFromYawPitchRoll(Single, Single, Single) CreateFromYawPitchRoll(Single, Single, Single) CreateFromYawPitchRoll(Single, Single, Single) CreateFromYawPitchRoll(Single, Single, Single)

依據指定的繞 Y 軸旋轉、繞 X 軸旋轉和滾動建立一個新四元數。Creates a new quaternion from the given yaw, pitch, and roll.

Divide(Quaternion, Quaternion) Divide(Quaternion, Quaternion) Divide(Quaternion, Quaternion) Divide(Quaternion, Quaternion)

將一個四元數除以第二個四元數。Divides one quaternion by a second quaternion.

Dot(Quaternion, Quaternion) Dot(Quaternion, Quaternion) Dot(Quaternion, Quaternion) Dot(Quaternion, Quaternion)

計算兩個四元數的內積。Calculates the dot product of two quaternions.

Equals(Quaternion) Equals(Quaternion) Equals(Quaternion) Equals(Quaternion)

傳回值,這個值指出此執行個體和另一個四元數是否相等。Returns a value that indicates whether this instance and another quaternion are equal.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

傳回值,這個值指出此執行個體和指定的物件是否相等。Returns a value that indicates whether this instance and a specified object are equal.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個執行個體的雜湊碼。Returns the hash code for this instance.

Inverse(Quaternion) Inverse(Quaternion) Inverse(Quaternion) Inverse(Quaternion)

傳回反四元數。Returns the inverse of a quaternion.

Length() Length() Length() Length()

計算此四元數的長度。Calculates the length of the quaternion.

LengthSquared() LengthSquared() LengthSquared() LengthSquared()

計算此四元數的長度平方。Calculates the squared length of the quaternion.

Lerp(Quaternion, Quaternion, Single) Lerp(Quaternion, Quaternion, Single) Lerp(Quaternion, Quaternion, Single) Lerp(Quaternion, Quaternion, Single)

根據指定第二個四元數之加權的值,執行兩個四元數之間的線性插補。Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion.

Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion)

傳回將兩個四元數一起相乘所產生的四元數。Returns the quaternion that results from multiplying two quaternions together.

Multiply(Quaternion, Single) Multiply(Quaternion, Single) Multiply(Quaternion, Single) Multiply(Quaternion, Single)

傳回四元數,該四元數為依據純量因數縮放指定四元數之所有元件而產生。Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor.

Negate(Quaternion) Negate(Quaternion) Negate(Quaternion) Negate(Quaternion)

將四元數的每個元件變換正負號。Reverses the sign of each component of the quaternion.

Normalize(Quaternion) Normalize(Quaternion) Normalize(Quaternion) Normalize(Quaternion)

將指定的 Quaternion 之每個元件除以其長度。Divides each component of a specified Quaternion by its length.

Slerp(Quaternion, Quaternion, Single) Slerp(Quaternion, Quaternion, Single) Slerp(Quaternion, Quaternion, Single) Slerp(Quaternion, Quaternion, Single)

使用球面線性插補,在兩個四元數間進行插補。Interpolates between two quaternions, using spherical linear interpolation.

Subtract(Quaternion, Quaternion) Subtract(Quaternion, Quaternion) Subtract(Quaternion, Quaternion) Subtract(Quaternion, Quaternion)

將第二個四元數中的每個元素減去第一個四元數中相對應的元素。Subtracts each element in a second quaternion from its corresponding element in a first quaternion.

ToString() ToString() ToString() ToString()

傳回表示這個四元數的字串。Returns a string that represents this quaternion.

運算子

Addition(Quaternion, Quaternion) Addition(Quaternion, Quaternion) Addition(Quaternion, Quaternion) Addition(Quaternion, Quaternion)

將一個四元數的每個元素和第二個四元數的相對應元素相加。Adds each element in one quaternion with its corresponding element in a second quaternion.

Division(Quaternion, Quaternion) Division(Quaternion, Quaternion) Division(Quaternion, Quaternion) Division(Quaternion, Quaternion)

將一個四元數除以第二個四元數。Divides one quaternion by a second quaternion.

Equality(Quaternion, Quaternion) Equality(Quaternion, Quaternion) Equality(Quaternion, Quaternion) Equality(Quaternion, Quaternion)

傳回值,指出兩個四元數是否相等。Returns a value that indicates whether two quaternions are equal.

Inequality(Quaternion, Quaternion) Inequality(Quaternion, Quaternion) Inequality(Quaternion, Quaternion) Inequality(Quaternion, Quaternion)

傳回值,指出兩個四元數是否不相等。Returns a value that indicates whether two quaternions are not equal.

Multiply(Quaternion, Single) Multiply(Quaternion, Single) Multiply(Quaternion, Single) Multiply(Quaternion, Single)

傳回四元數,該四元數為依據純量因數縮放指定四元數之所有元件而產生。Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor.

Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion)

傳回將兩個四元數一起相乘所產生的四元數。Returns the quaternion that results from multiplying two quaternions together.

Subtraction(Quaternion, Quaternion) Subtraction(Quaternion, Quaternion) Subtraction(Quaternion, Quaternion) Subtraction(Quaternion, Quaternion)

將第二個四元數中的每個元素減去第一個四元數中相對應的元素。Subtracts each element in a second quaternion from its corresponding element in a first quaternion.

UnaryNegation(Quaternion) UnaryNegation(Quaternion) UnaryNegation(Quaternion) UnaryNegation(Quaternion)

將四元數的每個元件變換正負號。Reverses the sign of each component of the quaternion.

適用於