Vector4 Vector4 Vector4 Vector4 Struct

定義

代表具有四個單精確度浮點值的向量。Represents a vector with four single-precision floating-point values.

public value class Vector4 : IEquatable<System::Numerics::Vector4>, IFormattable
public struct Vector4 : IEquatable<System.Numerics.Vector4>, IFormattable
type Vector4 = struct
    interface IFormattable
Public Structure Vector4
Implements IEquatable(Of Vector4), IFormattable
繼承
實作

備註

@No__t-0 結構提供硬體加速支援。The Vector4 structure provides support for hardware acceleration.

針對矩陣轉換,Vector2Vector3Vector4 執行個體會以資料列表示:向量 v 由矩陣 MvM 乘法轉換。For matrix transformations, the Vector2, Vector3, and Vector4 instances are represented as rows: a vector v is transformed by a matrix M with vM multiplication.

建構函式

Vector4(Single) Vector4(Single) Vector4(Single) Vector4(Single)

建立新的 Vector4 物件,其四個元素具有相同的值。Creates a new Vector4 object whose four elements have the same value.

Vector4(Vector3, Single) Vector4(Vector3, Single) Vector4(Vector3, Single) Vector4(Vector3, Single)

從指定的 Vector3 物件以及 W 元件,建構新的 Vector4 物件。Constructs a new Vector4 object from the specified Vector3 object and a W component.

Vector4(Vector2, Single, Single) Vector4(Vector2, Single, Single) Vector4(Vector2, Single, Single) Vector4(Vector2, Single, Single)

從指定的 Vector2 物件以及 Z 和 W 元件,建立新的 Vector4 物件。Creates a new Vector4 object from the specified Vector2 object and a Z and a W component.

Vector4(Single, Single, Single, Single) Vector4(Single, Single, Single, Single) Vector4(Single, Single, Single, Single) Vector4(Single, Single, Single, Single)

建立一個向量,其元素具有指定的值。Creates a vector whose elements have the specified values.

欄位

W W W W

此向量的 W 元件。The W component of the vector.

X X X X

此向量的 X 元件。The X component of the vector.

Y Y Y Y

此向量的 Y 元件。The Y component of the vector.

Z Z Z Z

此向量的 Z 元件。The Z component of the vector.

屬性

One One One One

取得其 4 個元素等於 1 的向量。Gets a vector whose 4 elements are equal to one.

UnitW UnitW UnitW UnitW

取得向量 (0,0,0,1)。Gets the vector (0,0,0,1).

UnitX UnitX UnitX UnitX

取得向量 (1,0,0,0)。Gets the vector (1,0,0,0).

UnitY UnitY UnitY UnitY

取得向量 (0,1,0,0)。Gets the vector (0,1,0,0).

UnitZ UnitZ UnitZ UnitZ

取得向量 (0,0,1,0)。Gets the vector (0,0,1,0).

Zero Zero Zero Zero

取得其 4 個元素等於 0 的向量。Gets a vector whose 4 elements are equal to zero.

方法

Abs(Vector4) Abs(Vector4) Abs(Vector4) Abs(Vector4)

傳回一個向量,其元素為指定向量之每個元素的絕對值。Returns a vector whose elements are the absolute values of each of the specified vector's elements.

Add(Vector4, Vector4) Add(Vector4, Vector4) Add(Vector4, Vector4) Add(Vector4, Vector4)

將兩個向量一起相加。Adds two vectors together.

Clamp(Vector4, Vector4, Vector4) Clamp(Vector4, Vector4, Vector4) Clamp(Vector4, Vector4, Vector4) Clamp(Vector4, Vector4, Vector4)

限制向量介於最小值和最大值之間。Restricts a vector between a minimum and a maximum value.

CopyTo(Single[]) CopyTo(Single[]) CopyTo(Single[]) CopyTo(Single[])

將向量的元素複製到指定的陣列。Copies the elements of the vector to a specified array.

CopyTo(Single[], Int32) CopyTo(Single[], Int32) CopyTo(Single[], Int32) CopyTo(Single[], Int32)

從指定的索引位置開始,將向量的元素複製到指定的陣列。Copies the elements of the vector to a specified array starting at a specified index position.

Distance(Vector4, Vector4) Distance(Vector4, Vector4) Distance(Vector4, Vector4) Distance(Vector4, Vector4)

計算兩個指定的點之間的歐幾里得距離。Computes the Euclidean distance between the two given points.

DistanceSquared(Vector4, Vector4) DistanceSquared(Vector4, Vector4) DistanceSquared(Vector4, Vector4) DistanceSquared(Vector4, Vector4)

傳回兩個指定的點之間的平方歐幾里得距離。Returns the Euclidean distance squared between two specified points.

Divide(Vector4, Vector4) Divide(Vector4, Vector4) Divide(Vector4, Vector4) Divide(Vector4, Vector4)

將第一個向量除以第二個。Divides the first vector by the second.

Divide(Vector4, Single) Divide(Vector4, Single) Divide(Vector4, Single) Divide(Vector4, Single)

指定的向量除以指定的純量值。Divides the specified vector by a specified scalar value.

Dot(Vector4, Vector4) Dot(Vector4, Vector4) Dot(Vector4, Vector4) Dot(Vector4, Vector4)

傳回兩個向量的內積。Returns the dot product of two vectors.

Equals(Vector4) Equals(Vector4) Equals(Vector4) Equals(Vector4)

傳回值,這個值指出此執行個體和另一個向量是否相等。Returns a value that indicates whether this instance and another vector 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.

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

傳回這個向量物件的長度。Returns the length of this vector object.

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

傳回向量長度平方。Returns the length of the vector squared.

Lerp(Vector4, Vector4, Single) Lerp(Vector4, Vector4, Single) Lerp(Vector4, Vector4, Single) Lerp(Vector4, Vector4, Single)

根據給定的加權執行兩個向量之間的線性插補。Performs a linear interpolation between two vectors based on the given weighting.

Max(Vector4, Vector4) Max(Vector4, Vector4) Max(Vector4, Vector4) Max(Vector4, Vector4)

傳回一個向量,其元素為兩個指定向量之每個成對元素的最大值。Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors.

Min(Vector4, Vector4) Min(Vector4, Vector4) Min(Vector4, Vector4) Min(Vector4, Vector4)

傳回一個向量,其元素為兩個指定向量之每個成對元素的最小值。Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors.

Multiply(Vector4, Vector4) Multiply(Vector4, Vector4) Multiply(Vector4, Vector4) Multiply(Vector4, Vector4)

傳回新的向量,其值為兩個指定向量之每對元素的乘積。Returns a new vector whose values are the product of each pair of elements in two specified vectors.

Multiply(Vector4, Single) Multiply(Vector4, Single) Multiply(Vector4, Single) Multiply(Vector4, Single)

將向量乘以指定的純量。Multiplies a vector by a specified scalar.

Multiply(Single, Vector4) Multiply(Single, Vector4) Multiply(Single, Vector4) Multiply(Single, Vector4)

將純量值乘以指定的向量。Multiplies a scalar value by a specified vector.

Negate(Vector4) Negate(Vector4) Negate(Vector4) Negate(Vector4)

將指定的向量變換正負號。Negates a specified vector.

Normalize(Vector4) Normalize(Vector4) Normalize(Vector4) Normalize(Vector4)

傳回與指定向量方向相同的向量,但長度為 1。Returns a vector with the same direction as the specified vector, but with a length of one.

SquareRoot(Vector4) SquareRoot(Vector4) SquareRoot(Vector4) SquareRoot(Vector4)

傳回一個向量,其元素為指定向量之每個元素的平方根。Returns a vector whose elements are the square root of each of a specified vector's elements.

Subtract(Vector4, Vector4) Subtract(Vector4, Vector4) Subtract(Vector4, Vector4) Subtract(Vector4, Vector4)

從第一個向量減去第二個向量。Subtracts the second vector from the first.

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

使用預設格式傳回目前執行個體的字串表示。Returns the string representation of the current instance using default formatting.

ToString(String) ToString(String) ToString(String) ToString(String)

使用指定格式字串來格式化個別項目,傳回目前執行個體的字串表示。Returns the string representation of the current instance using the specified format string to format individual elements.

ToString(String, IFormatProvider) ToString(String, IFormatProvider) ToString(String, IFormatProvider) ToString(String, IFormatProvider)

使用指定格式字串來格式化個別項目,以及使用指定的格式提供者來定義特定文化特性的格式,傳回目前執行個體的字串表示。Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting.

Transform(Vector4, Quaternion) Transform(Vector4, Quaternion) Transform(Vector4, Quaternion) Transform(Vector4, Quaternion)

依據指定的四元數旋轉值來轉換四維向量。Transforms a four-dimensional vector by the specified Quaternion rotation value.

Transform(Vector4, Matrix4x4) Transform(Vector4, Matrix4x4) Transform(Vector4, Matrix4x4) Transform(Vector4, Matrix4x4)

依據指定的 4x4 矩陣轉換四維向量。Transforms a four-dimensional vector by a specified 4x4 matrix.

Transform(Vector3, Quaternion) Transform(Vector3, Quaternion) Transform(Vector3, Quaternion) Transform(Vector3, Quaternion)

依據指定的四元數旋轉值來轉換三維向量。Transforms a three-dimensional vector by the specified Quaternion rotation value.

Transform(Vector2, Matrix4x4) Transform(Vector2, Matrix4x4) Transform(Vector2, Matrix4x4) Transform(Vector2, Matrix4x4)

依據指定的 4x4 矩陣轉換二維向量。Transforms a two-dimensional vector by a specified 4x4 matrix.

Transform(Vector2, Quaternion) Transform(Vector2, Quaternion) Transform(Vector2, Quaternion) Transform(Vector2, Quaternion)

依據指定的四元數旋轉值來轉換二維向量。Transforms a two-dimensional vector by the specified Quaternion rotation value.

Transform(Vector3, Matrix4x4) Transform(Vector3, Matrix4x4) Transform(Vector3, Matrix4x4) Transform(Vector3, Matrix4x4)

依據指定的 4x4 矩陣轉換三維向量。Transforms a three-dimensional vector by a specified 4x4 matrix.

運算子

Addition(Vector4, Vector4) Addition(Vector4, Vector4) Addition(Vector4, Vector4) Addition(Vector4, Vector4)

將兩個向量一起相加。Adds two vectors together.

Division(Vector4, Vector4) Division(Vector4, Vector4) Division(Vector4, Vector4) Division(Vector4, Vector4)

將第一個向量除以第二個。Divides the first vector by the second.

Division(Vector4, Single) Division(Vector4, Single) Division(Vector4, Single) Division(Vector4, Single)

指定的向量除以指定的純量值。Divides the specified vector by a specified scalar value.

Equality(Vector4, Vector4) Equality(Vector4, Vector4) Equality(Vector4, Vector4) Equality(Vector4, Vector4)

傳回值,指出兩個指定向量的每個成對元素是否相等。Returns a value that indicates whether each pair of elements in two specified vectors is equal.

Inequality(Vector4, Vector4) Inequality(Vector4, Vector4) Inequality(Vector4, Vector4) Inequality(Vector4, Vector4)

傳回值,這個值表示兩個指定的向量是否不相等。Returns a value that indicates whether two specified vectors are not equal.

Multiply(Vector4, Vector4) Multiply(Vector4, Vector4) Multiply(Vector4, Vector4) Multiply(Vector4, Vector4)

傳回新的向量,其值為兩個指定向量之每對元素的乘積。Returns a new vector whose values are the product of each pair of elements in two specified vectors.

Multiply(Vector4, Single) Multiply(Vector4, Single) Multiply(Vector4, Single) Multiply(Vector4, Single)

指定的向量乘以指定的純量值。Multiples the specified vector by the specified scalar value.

Multiply(Single, Vector4) Multiply(Single, Vector4) Multiply(Single, Vector4) Multiply(Single, Vector4)

將純量值乘以指定的向量。Multiples the scalar value by the specified vector.

Subtraction(Vector4, Vector4) Subtraction(Vector4, Vector4) Subtraction(Vector4, Vector4) Subtraction(Vector4, Vector4)

從第一個向量減去第二個向量。Subtracts the second vector from the first.

UnaryNegation(Vector4) UnaryNegation(Vector4) UnaryNegation(Vector4) UnaryNegation(Vector4)

將指定的向量變換正負號。Negates the specified vector.

適用於