Vector4 Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- Inheritance
- Implements
Remarks
The Vector4 structure provides support for hardware acceleration.
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.
Constructors
Vector4(ReadOnlySpan<Single>) |
Constructs a vector from the given ReadOnlySpan<T>. The span must contain at least 4 elements. |
Vector4(Single) |
Creates a new Vector4 object whose four elements have the same value. |
Vector4(Single, Single, Single, Single) |
Creates a vector whose elements have the specified values. |
Vector4(Vector2, Single, Single) |
Creates a new Vector4 object from the specified Vector2 object and a Z and a W component. |
Vector4(Vector3, Single) |
Constructs a new Vector4 object from the specified Vector3 object and a W component. |
Fields
W |
The W component of the vector. |
X |
The X component of the vector. |
Y |
The Y component of the vector. |
Z |
The Z component of the vector. |
Properties
E | |
Epsilon | |
Item[Int32] |
Gets or sets the element at the specified index. |
NaN | |
NegativeInfinity | |
NegativeZero | |
One |
Gets a vector whose 4 elements are equal to one. |
Pi | |
PositiveInfinity | |
Tau | |
UnitW |
Gets the vector (0,0,0,1). |
UnitX |
Gets the vector (1,0,0,0). |
UnitY |
Gets the vector (0,1,0,0). |
UnitZ |
Gets the vector (0,0,1,0). |
Zero |
Gets a vector whose 4 elements are equal to zero. |
Methods
Abs(Vector4) |
Returns a vector whose elements are the absolute values of each of the specified vector's elements. |
Add(Vector4, Vector4) |
Adds two vectors together. |
Clamp(Vector4, Vector4, Vector4) |
Restricts a vector between a minimum and a maximum value. |
ClampNative(Vector4, Vector4, Vector4) | |
CopySign(Vector4, Vector4) | |
CopyTo(Single[]) |
Copies the elements of the vector to a specified array. |
CopyTo(Single[], Int32) |
Copies the elements of the vector to a specified array starting at a specified index position. |
CopyTo(Span<Single>) |
Copies the vector to the given Span<T>. The length of the destination span must be at least 4. |
Cos(Vector4) | |
Create(ReadOnlySpan<Single>) |
Constructs a vector from the given ReadOnlySpan<T>. The span must contain at least 4 elements. |
Create(Single) |
Creates a new Vector4 object whose four elements have the same value. |
Create(Single, Single, Single, Single) |
Creates a vector whose elements have the specified values. |
Create(Vector2, Single, Single) |
Creates a new Vector4 object from the specified Vector2 object and a Z and a W component. |
Create(Vector3, Single) |
Constructs a new Vector4 object from the specified Vector3 object and a W component. |
DegreesToRadians(Vector4) | |
Distance(Vector4, Vector4) |
Computes the Euclidean distance between the two given points. |
DistanceSquared(Vector4, Vector4) |
Returns the Euclidean distance squared between two specified points. |
Divide(Vector4, Single) |
Divides the specified vector by a specified scalar value. |
Divide(Vector4, Vector4) |
Divides the first vector by the second. |
Dot(Vector4, Vector4) |
Returns the dot product of two vectors. |
Equals(Object) |
Returns a value that indicates whether this instance and a specified object are equal. |
Equals(Vector4) |
Returns a value that indicates whether this instance and another vector are equal. |
Exp(Vector4) | |
FusedMultiplyAdd(Vector4, Vector4, Vector4) | |
GetHashCode() |
Returns the hash code for this instance. |
Hypot(Vector4, Vector4) | |
Length() |
Returns the length of this vector object. |
LengthSquared() |
Returns the length of the vector squared. |
Lerp(Vector4, Vector4, Single) |
Performs a linear interpolation between two vectors based on the given weighting. |
Lerp(Vector4, Vector4, Vector4) | |
Log(Vector4) | |
Log2(Vector4) | |
Max(Vector4, Vector4) |
Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. |
MaxMagnitude(Vector4, Vector4) | |
MaxMagnitudeNumber(Vector4, Vector4) | |
MaxNative(Vector4, Vector4) | |
MaxNumber(Vector4, Vector4) | |
Min(Vector4, Vector4) |
Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. |
MinMagnitude(Vector4, Vector4) | |
MinMagnitudeNumber(Vector4, Vector4) | |
MinNative(Vector4, Vector4) | |
MinNumber(Vector4, Vector4) | |
Multiply(Single, Vector4) |
Multiplies a scalar value by a specified vector. |
Multiply(Vector4, Single) |
Multiplies a vector by a specified scalar. |
Multiply(Vector4, Vector4) |
Returns a new vector whose values are the product of each pair of elements in two specified vectors. |
MultiplyAddEstimate(Vector4, Vector4, Vector4) | |
Negate(Vector4) |
Negates a specified vector. |
Normalize(Vector4) |
Returns a vector with the same direction as the specified vector, but with a length of one. |
RadiansToDegrees(Vector4) | |
Round(Vector4) | |
Round(Vector4, MidpointRounding) | |
Sin(Vector4) | |
SinCos(Vector4) | |
SquareRoot(Vector4) |
Returns a vector whose elements are the square root of each of a specified vector's elements. |
Subtract(Vector4, Vector4) |
Subtracts the second vector from the first. |
ToString() |
Returns the string representation of the current instance using default formatting. |
ToString(String) |
Returns the string representation of the current instance using the specified format string to format individual elements. |
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(Vector2, Matrix4x4) |
Transforms a two-dimensional vector by a specified 4x4 matrix. |
Transform(Vector2, Quaternion) |
Transforms a two-dimensional vector by the specified Quaternion rotation value. |
Transform(Vector3, Matrix4x4) |
Transforms a three-dimensional vector by a specified 4x4 matrix. |
Transform(Vector3, Quaternion) |
Transforms a three-dimensional vector by the specified Quaternion rotation value. |
Transform(Vector4, Matrix4x4) |
Transforms a four-dimensional vector by a specified 4x4 matrix. |
Transform(Vector4, Quaternion) |
Transforms a four-dimensional vector by the specified Quaternion rotation value. |
Truncate(Vector4) | |
TryCopyTo(Span<Single>) |
Attempts to copy the vector to the given Span<T>. The length of the destination span must be at least 4. |
Operators
Addition(Vector4, Vector4) |
Adds two vectors together. |
Division(Vector4, Single) |
Divides the specified vector by a specified scalar value. |
Division(Vector4, Vector4) |
Divides the first vector by the second. |
Equality(Vector4, Vector4) |
Returns a value that indicates whether each pair of elements in two specified vectors is equal. |
Inequality(Vector4, Vector4) |
Returns a value that indicates whether two specified vectors are not equal. |
Multiply(Single, Vector4) |
Multiples the scalar value by the specified vector. |
Multiply(Vector4, Single) |
Multiples the specified vector by the specified scalar value. |
Multiply(Vector4, Vector4) |
Returns a new vector whose values are the product of each pair of elements in two specified vectors. |
Subtraction(Vector4, Vector4) |
Subtracts the second vector from the first. |
UnaryNegation(Vector4) |
Negates the specified vector. |
Extension Methods
AsPlane(Vector4) | |
AsQuaternion(Vector4) |
Reinterprets a Vector4 as a new Quaternion. |
AsVector2(Vector4) | |
AsVector3(Vector4) | |
AsVector128(Vector4) |
Reinterprets a Vector4 as a new Vector128<T>. |
Applies to
Povratne informacije
https://aka.ms/ContentUserFeedback.
Kmalu na voljo: V letu 2024 bomo ukinili storitev Težave v storitvi GitHub kot mehanizem za povratne informacije za vsebino in jo zamenjali z novim sistemom za povratne informacije. Za več informacij si oglejte:Pošlji in prikaži povratne informacije za