<PackageReference Include="System.Numerics.Vectors" Version="4.5.0-rc1" />

System.Numerics.Vector4

Represents a vector with four single-precision floating-point values.
public float W

The W component of the vector.

public float X

The X component of the vector.

public float Y

The Y component of the vector.

public float Z

The Z component of the vector.

public static Vector4 One { get; }

Gets a vector whose 4 elements are equal to one.

public static Vector4 UnitW { get; }

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

public static Vector4 UnitX { get; }

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

public static Vector4 UnitY { get; }

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

public static Vector4 UnitZ { get; }

Gets a vector whose 4 elements are equal to zero.

public static Vector4 Zero { get; }

Gets a vector whose 4 elements are equal to zero.

public Vector4(float value)

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

public Vector4(float x, float y, float z, float w)

Creates a vector whose elements have the specified values.

public Vector4(Vector2 value, float z, float w)

Creates a new Vector4 object from the specified Vector2 object and a Z and a W component.

public Vector4(Vector3 value, float w)

Constructs a new Vector4 object from the specified Vector3 object and a W component.

public static Vector4 Abs(Vector4 value)

Returns a vector whose elements are the absolute values of each of the specified vector&#39;s elements.

public static Vector4 Add(Vector4 left, Vector4 right)

Adds two vectors together.

public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max)

Restricts a vector between a minimum and a maximum value.

public static float Distance(Vector4 value1, Vector4 value2)

Computes the Euclidean distance between the two given points.

public static float DistanceSquared(Vector4 value1, Vector4 value2)

Returns the Euclidean distance squared between two specified points.

public static Vector4 Divide(Vector4 left, Vector4 right)

Divides the first vector by the second.

public static Vector4 Divide(Vector4 left, float divisor)

Divides the specified vector by a specified scalar value.

public static float Dot(Vector4 vector1, Vector4 vector2)

Returns the dot product of two vectors.

public static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount)

Performs a linear interpolation between two vectors based on the given weighting.

public static Vector4 Max(Vector4 value1, Vector4 value2)

Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors.

public static Vector4 Min(Vector4 value1, Vector4 value2)

Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors.

public static Vector4 Multiply(Vector4 left, Vector4 right)

Multiplies two vectors together.

public static Vector4 Multiply(Vector4 left, float right)

Multiplies a vector by a specified scalar.

public static Vector4 Multiply(float left, Vector4 right)

Multiplies a scalar value by a specified vector.

public static Vector4 Negate(Vector4 value)

Negates a specified vector.

public static Vector4 Normalize(Vector4 vector)

Returns a vector with the same direction as the specified vector, but with a length of one.

public static Vector4 op_Addition(Vector4 left, Vector4 right)

Adds two vectors together.

public static Vector4 op_Division(Vector4 left, Vector4 right)

Divides the first vector by the second.

public static Vector4 op_Division(Vector4 value1, float value2)

Divides the specified vector by a specified scalar value.

public static bool op_Equality(Vector4 left, Vector4 right)

Returns a value that indicates whether each pair of elements in two specified vectors is equal.

public static bool op_Inequality(Vector4 left, Vector4 right)

Returns a value that indicates whether two specified vectors are not equal.

public static Vector4 op_Multiply(Vector4 left, Vector4 right)

Multiplies two vectors together.

public static Vector4 op_Multiply(Vector4 left, float right)

Multiples the specified vector by the specified scalar value.

public static Vector4 op_Multiply(float left, Vector4 right)

Multiples the scalar value by the specified vector.

public static Vector4 op_Subtraction(Vector4 left, Vector4 right)

Subtracts the second vector from the first.

public static Vector4 op_UnaryNegation(Vector4 value)

Negates the specified vector.

public static Vector4 SquareRoot(Vector4 value)

Returns a vector whose elements are the square root of each of a specified vector&#39;s elements.

public static Vector4 Subtract(Vector4 left, Vector4 right)

Subtracts the second vector from the first.

public static Vector4 Transform(Vector2 position, Matrix4x4 matrix)

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

public static Vector4 Transform(Vector3 position, Matrix4x4 matrix)

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

public static Vector4 Transform(Vector4 vector, Matrix4x4 matrix)

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

public static Vector4 Transform(Vector2 value, Quaternion rotation)

Transforms a two-dimensional vector by the specified Quaternion rotation value.

public static Vector4 Transform(Vector3 value, Quaternion rotation)

Transforms a three-dimensional vector by the specified Quaternion rotation value.

public static Vector4 Transform(Vector4 value, Quaternion rotation)

Transforms a four-dimensional vector by the specified Quaternion rotation value.

public void CopyTo(float[] array)

Copies the elements of the vector to a specified array.

public void CopyTo(float[] array, int index)

Copies the elements of the vector to a specified array starting at a specified index position.

public bool Equals(Vector4 other)

Returns a value that indicates whether this instance and another vector are equal.

public float Length()

Returns the length of this vector object.

public float LengthSquared()

Returns the length of the vector squared.

public string ToString(string format)

Returns the string representation of the current instance using the specified format string to format individual elements.

public string ToString(string format, IFormatProvider formatProvider)

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.