Vector4 Vector4 Vector4 Vector4 Struct

Definition

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(Single) Vector4(Single) Vector4(Single) Vector4(Single)

Creates a new Vector4 object whose four elements have the same value.

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

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)

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.

Fields

W W W W

The W component of the vector.

X X X X

The X component of the vector.

Y Y Y Y

The Y component of the vector.

Z Z Z Z

The Z component of the vector.

Properties

One One One One

Gets a vector whose 4 elements are equal to one.

UnitW UnitW UnitW UnitW

Gets the vector (0,0,0,1).

UnitX UnitX UnitX UnitX

Gets the vector (1,0,0,0).

UnitY UnitY UnitY UnitY

Gets the vector (0,1,0,0).

UnitZ UnitZ UnitZ UnitZ

Gets the vector (0,0,1,0).

Zero Zero Zero Zero

Gets a vector whose 4 elements are equal to zero.

Methods

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)

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)

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)

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)

Transforms a three-dimensional vector by a specified 4x4 matrix.

Operators

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.

Applies to