Show / Hide Table of Contents

Class Vector4D

Defines a vector with four components.

Inheritance
System.Object
Vector4D
Namespace: VRageMath
Assembly: VRage.Math.dll
Syntax
public sealed class Vector4D : ValueType, IEquatable<Vector4>

Constructors

Vector4D(Double)

Creates a new instance of Vector4.

Declaration
public Vector4D(double value)
Parameters
Type Name Description
System.Double value

Value to initialize each component to.

Vector4D(Double, Double, Double, Double)

Initializes a new instance of Vector4.

Declaration
public Vector4D(double x, double y, double z, double w)
Parameters
Type Name Description
System.Double x

Initial value for the x-component of the vector.

System.Double y

Initial value for the y-component of the vector.

System.Double z

Initial value for the z-component of the vector.

System.Double w

Initial value for the w-component of the vector.

Vector4D(Vector2, Double, Double)

Initializes a new instance of Vector4.

Declaration
public Vector4D(Vector2 value, double z, double w)
Parameters
Type Name Description
Vector2 value

A vector containing the values to initialize x and y components with.

System.Double z

Initial value for the z-component of the vector.

System.Double w

Initial value for the w-component of the vector.

Vector4D(Vector3D, Double)

Initializes a new instance of Vector4.

Declaration
public Vector4D(Vector3D value, double w)
Parameters
Type Name Description
Vector3D value

A vector containing the values to initialize x, y, and z components with.

System.Double w

Initial value for the w-component of the vector.

Fields

One

Declaration
public static Vector4D One
Field Value
Type Description
Vector4D

UnitW

Declaration
public static Vector4D UnitW
Field Value
Type Description
Vector4D

UnitX

Declaration
public static Vector4D UnitX
Field Value
Type Description
Vector4D

UnitY

Declaration
public static Vector4D UnitY
Field Value
Type Description
Vector4D

UnitZ

Declaration
public static Vector4D UnitZ
Field Value
Type Description
Vector4D

W

Gets or sets the w-component of the vector.

Declaration
public double W
Field Value
Type Description
System.Double

X

Gets or sets the x-component of the vector.

Declaration
public double X
Field Value
Type Description
System.Double

Y

Gets or sets the y-component of the vector.

Declaration
public double Y
Field Value
Type Description
System.Double

Z

Gets or sets the z-component of the vector.

Declaration
public double Z
Field Value
Type Description
System.Double

Zero

Declaration
public static Vector4D Zero
Field Value
Type Description
Vector4D

Methods

Add(Vector4D, Vector4D)

Adds two vectors.

Declaration
public static Vector4D Add(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

Returns
Type Description
Vector4D

Add(ref Vector4D, ref Vector4D, out Vector4D)

Adds two vectors.

Declaration
public static void Add(ref Vector4D value1, ref Vector4D value2, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

Vector4D result

[OutAttribute] Sum of the source vectors.

Barycentric(Vector4D, Vector4D, Vector4D, Double, Double)

Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle.

Declaration
public static Vector4D Barycentric(Vector4D value1, Vector4D value2, Vector4D value3, double amount1, double amount2)
Parameters
Type Name Description
Vector4D value1

A Vector4 containing the 4D Cartesian coordinates of vertex 1 of the triangle.

Vector4D value2

A Vector4 containing the 4D Cartesian coordinates of vertex 2 of the triangle.

Vector4D value3

A Vector4 containing the 4D Cartesian coordinates of vertex 3 of the triangle.

System.Double amount1

Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).

System.Double amount2

Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

Returns
Type Description
Vector4D

Barycentric(ref Vector4D, ref Vector4D, ref Vector4D, Double, Double, out Vector4D)

Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in Barycentric (areal) coordinates relative to a 4D triangle.

Declaration
public static void Barycentric(ref Vector4D value1, ref Vector4D value2, ref Vector4D value3, double amount1, double amount2, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

A Vector4 containing the 4D Cartesian coordinates of vertex 1 of the triangle.

Vector4D value2

A Vector4 containing the 4D Cartesian coordinates of vertex 2 of the triangle.

Vector4D value3

A Vector4 containing the 4D Cartesian coordinates of vertex 3 of the triangle.

System.Double amount1

Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).

System.Double amount2

Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

Vector4D result

[OutAttribute] The 4D Cartesian coordinates of the specified point are placed in this Vector4 on exit.

CatmullRom(Vector4D, Vector4D, Vector4D, Vector4D, Double)

Performs a Catmull-Rom interpolation using the specified positions.

Declaration
public static Vector4D CatmullRom(Vector4D value1, Vector4D value2, Vector4D value3, Vector4D value4, double amount)
Parameters
Type Name Description
Vector4D value1

The first position in the interpolation.

Vector4D value2

The second position in the interpolation.

Vector4D value3

The third position in the interpolation.

Vector4D value4

The fourth position in the interpolation.

System.Double amount

Weighting factor.

Returns
Type Description
Vector4D

CatmullRom(ref Vector4D, ref Vector4D, ref Vector4D, ref Vector4D, Double, out Vector4D)

Performs a Catmull-Rom interpolation using the specified positions.

Declaration
public static void CatmullRom(ref Vector4D value1, ref Vector4D value2, ref Vector4D value3, ref Vector4D value4, double amount, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

The first position in the interpolation.

Vector4D value2

The second position in the interpolation.

Vector4D value3

The third position in the interpolation.

Vector4D value4

The fourth position in the interpolation.

System.Double amount

Weighting factor.

Vector4D result

[OutAttribute] A vector that is the result of the Catmull-Rom interpolation.

Clamp(Vector4D, Vector4D, Vector4D)

Restricts a value to be within a specified range.

Declaration
public static Vector4D Clamp(Vector4D value1, Vector4D min, Vector4D max)
Parameters
Type Name Description
Vector4D value1

The value to clamp.

Vector4D min

The minimum value.

Vector4D max

The maximum value.

Returns
Type Description
Vector4D

Clamp(ref Vector4D, ref Vector4D, ref Vector4D, out Vector4D)

Restricts a value to be within a specified range.

Declaration
public static void Clamp(ref Vector4D value1, ref Vector4D min, ref Vector4D max, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

The value to clamp.

Vector4D min

The minimum value.

Vector4D max

The maximum value.

Vector4D result

[OutAttribute] The clamped value.

Distance(Vector4, Vector4)

Calculates the distance between two vectors.

Declaration
public static double Distance(Vector4 value1, Vector4 value2)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

Returns
Type Description
System.Double

Distance(ref Vector4, ref Vector4, out Double)

Calculates the distance between two vectors.

Declaration
public static void Distance(ref Vector4 value1, ref Vector4 value2, out double result)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

System.Double result

[OutAttribute] The distance between the vectors.

DistanceSquared(Vector4, Vector4)

Calculates the distance between two vectors squared.

Declaration
public static double DistanceSquared(Vector4 value1, Vector4 value2)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

Returns
Type Description
System.Double

DistanceSquared(ref Vector4, ref Vector4, out Double)

Calculates the distance between two vectors squared.

Declaration
public static void DistanceSquared(ref Vector4 value1, ref Vector4 value2, out double result)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

System.Double result

[OutAttribute] The distance between the two vectors squared.

Divide(Vector4D, Double)

Divides a vector by a scalar value.

Declaration
public static Vector4D Divide(Vector4D value1, double divider)
Parameters
Type Name Description
Vector4D value1

Source vector.

System.Double divider

The divisor.

Returns
Type Description
Vector4D

Divide(Vector4D, Vector4D)

Divides the components of a vector by the components of another vector.

Declaration
public static Vector4D Divide(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Divisor vector.

Returns
Type Description
Vector4D

Divide(ref Vector4D, Double, out Vector4D)

Divides a vector by a scalar value.

Declaration
public static void Divide(ref Vector4D value1, double divider, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

Source vector.

System.Double divider

The divisor.

Vector4D result

[OutAttribute] The result of the division.

Divide(ref Vector4D, ref Vector4D, out Vector4D)

Divides the components of a vector by the components of another vector.

Declaration
public static void Divide(ref Vector4D value1, ref Vector4D value2, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

The divisor.

Vector4D result

[OutAttribute] The result of the division.

Dot(Vector4, Vector4)

Calculates the dot product of two vectors.

Declaration
public static double Dot(Vector4 vector1, Vector4 vector2)
Parameters
Type Name Description
Vector4 vector1

Source vector.

Vector4 vector2

Source vector.

Returns
Type Description
System.Double

Dot(ref Vector4, ref Vector4, out Double)

Calculates the dot product of two vectors.

Declaration
public static void Dot(ref Vector4 vector1, ref Vector4 vector2, out double result)
Parameters
Type Name Description
Vector4 vector1

Source vector.

Vector4 vector2

Source vector.

System.Double result

[OutAttribute] The dot product of the two vectors.

Equals(Object)

Returns a value that indicates whether the current instance is equal to a specified object.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

Object with which to make the comparison.

Returns
Type Description
System.Boolean

Equals(Vector4)

Determines whether the specified Object is equal to the Vector4.

Declaration
public bool Equals(Vector4 other)
Parameters
Type Name Description
Vector4 other

The Vector4 to compare with the current Vector4.

Returns
Type Description
System.Boolean

GetHashCode()

Gets the hash code of this object.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

Hermite(Vector4D, Vector4D, Vector4D, Vector4D, Double)

Performs a Hermite spline interpolation.

Declaration
public static Vector4D Hermite(Vector4D value1, Vector4D tangent1, Vector4D value2, Vector4D tangent2, double amount)
Parameters
Type Name Description
Vector4D value1

Source position vector.

Vector4D tangent1

Source tangent vector.

Vector4D value2

Source position vector.

Vector4D tangent2

Source tangent vector.

System.Double amount

Weighting factor.

Returns
Type Description
Vector4D

Hermite(ref Vector4D, ref Vector4D, ref Vector4D, ref Vector4D, Double, out Vector4D)

Performs a Hermite spline interpolation.

Declaration
public static void Hermite(ref Vector4D value1, ref Vector4D tangent1, ref Vector4D value2, ref Vector4D tangent2, double amount, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

Source position vector.

Vector4D tangent1

Source tangent vector.

Vector4D value2

Source position vector.

Vector4D tangent2

Source tangent vector.

System.Double amount

Weighting factor.

Vector4D result

[OutAttribute] The result of the Hermite spline interpolation.

Length()

Calculates the length of the vector.

Declaration
public double Length()
Returns
Type Description
System.Double

LengthSquared()

Calculates the length of the vector squared.

Declaration
public double LengthSquared()
Returns
Type Description
System.Double

Lerp(Vector4D, Vector4D, Double)

Performs a linear interpolation between two vectors.

Declaration
public static Vector4D Lerp(Vector4D value1, Vector4D value2, double amount)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

System.Double amount

Value between 0 and 1 indicating the weight of value2.

Returns
Type Description
Vector4D

Lerp(ref Vector4D, ref Vector4D, Double, out Vector4D)

Performs a linear interpolation between two vectors.

Declaration
public static void Lerp(ref Vector4D value1, ref Vector4D value2, double amount, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

System.Double amount

Value between 0 and 1 indicating the weight of value2.

Vector4D result

[OutAttribute] The result of the interpolation.

Max(Vector4, Vector4)

Returns a vector that contains the highest value from each matching pair of components.

Declaration
public static Vector4 Max(Vector4 value1, Vector4 value2)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

Returns
Type Description
Vector4

Max(ref Vector4, ref Vector4, out Vector4)

Returns a vector that contains the highest value from each matching pair of components.

Declaration
public static void Max(ref Vector4 value1, ref Vector4 value2, out Vector4 result)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

Vector4 result

[OutAttribute] The maximized vector.

Min(Vector4, Vector4)

Returns a vector that contains the lowest value from each matching pair of components.

Declaration
public static Vector4 Min(Vector4 value1, Vector4 value2)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

Returns
Type Description
Vector4

Min(ref Vector4, ref Vector4, out Vector4)

Returns a vector that contains the lowest value from each matching pair of components.

Declaration
public static void Min(ref Vector4 value1, ref Vector4 value2, out Vector4 result)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

Vector4 result

[OutAttribute] The minimized vector.

Multiply(ref Vector4, ref Vector4, out Vector4)

Multiplies the components of two vectors by each other.

Declaration
public static void Multiply(ref Vector4 value1, ref Vector4 value2, out Vector4 result)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

Vector4 result

[OutAttribute] The result of the multiplication.

Multiply(Vector4D, Double)

Multiplies a vector by a scalar.

Declaration
public static Vector4D Multiply(Vector4D value1, double scaleFactor)
Parameters
Type Name Description
Vector4D value1

Source vector.

System.Double scaleFactor

Scalar value.

Returns
Type Description
Vector4D

Multiply(Vector4D, Vector4D)

Multiplies the components of two vectors by each other.

Declaration
public static Vector4D Multiply(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

Returns
Type Description
Vector4D

Multiply(ref Vector4D, Double, out Vector4D)

Multiplies a vector by a scalar value.

Declaration
public static void Multiply(ref Vector4D value1, double scaleFactor, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

Source vector.

System.Double scaleFactor

Scalar value.

Vector4D result

[OutAttribute] The result of the multiplication.

Negate(Vector4D)

Returns a vector pointing in the opposite direction.

Declaration
public static Vector4D Negate(Vector4D value)
Parameters
Type Name Description
Vector4D value

Source vector.

Returns
Type Description
Vector4D

Negate(ref Vector4D, out Vector4D)

Returns a vector pointing in the opposite direction.

Declaration
public static void Negate(ref Vector4D value, out Vector4D result)
Parameters
Type Name Description
Vector4D value

Source vector.

Vector4D result

[OutAttribute] Vector pointing in the opposite direction.

Normalize()

Turns the current vector into a unit vector.

Declaration
public void Normalize()

Normalize(Vector4D)

Creates a unit vector from the specified vector.

Declaration
public static Vector4D Normalize(Vector4D vector)
Parameters
Type Name Description
Vector4D vector

The source Vector4.

Returns
Type Description
Vector4D

Normalize(ref Vector4D, out Vector4D)

Returns a normalized version of the specified vector.

Declaration
public static void Normalize(ref Vector4D vector, out Vector4D result)
Parameters
Type Name Description
Vector4D vector

Source vector.

Vector4D result

[OutAttribute] The normalized vector.

PackOrthoMatrix(ref MatrixD)

Declaration
public static Vector4D PackOrthoMatrix(ref MatrixD matrix)
Parameters
Type Name Description
MatrixD matrix
Returns
Type Description
Vector4D

PackOrthoMatrix(Vector3D, Vector3, Vector3)

Declaration
public static Vector4D PackOrthoMatrix(Vector3D position, Vector3 forward, Vector3 up)
Parameters
Type Name Description
Vector3D position
Vector3 forward
Vector3 up
Returns
Type Description
Vector4D

SmoothStep(Vector4D, Vector4D, Double)

Interpolates between two values using a cubic equation.

Declaration
public static Vector4D SmoothStep(Vector4D value1, Vector4D value2, double amount)
Parameters
Type Name Description
Vector4D value1

Source value.

Vector4D value2

Source value.

System.Double amount

Weighting value.

Returns
Type Description
Vector4D

SmoothStep(ref Vector4D, ref Vector4D, Double, out Vector4D)

Interpolates between two values using a cubic equation.

Declaration
public static void SmoothStep(ref Vector4D value1, ref Vector4D value2, double amount, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

System.Double amount

Weighting factor.

Vector4D result

[OutAttribute] The interpolated value.

Subtract(Vector4, Vector4)

Subtracts a vector from a vector.

Declaration
public static Vector4 Subtract(Vector4 value1, Vector4 value2)
Parameters
Type Name Description
Vector4 value1

Source vector.

Vector4 value2

Source vector.

Returns
Type Description
Vector4

Subtract(ref Vector4D, ref Vector4D, out Vector4D)

Subtracts a vector from a vector.

Declaration
public static void Subtract(ref Vector4D value1, ref Vector4D value2, out Vector4D result)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

Vector4D result

[OutAttribute] The result of the subtraction.

ToString()

Retrieves a string representation of the current object.

Declaration
public override string ToString()
Returns
Type Description
System.String

Transform(Vector2, MatrixD)

Transforms a Vector2 by the given Matrix.

Declaration
public static Vector4D Transform(Vector2 position, MatrixD matrix)
Parameters
Type Name Description
Vector2 position

The source Vector2.

MatrixD matrix

The transformation Matrix.

Returns
Type Description
Vector4D

Transform(Vector2, Quaternion)

Transforms a Vector2 by a specified Quaternion into a Vector4.

Declaration
public static Vector4D Transform(Vector2 value, Quaternion rotation)
Parameters
Type Name Description
Vector2 value

The Vector2 to transform.

Quaternion rotation

The Quaternion rotation to apply.

Returns
Type Description
Vector4D

Transform(ref Vector2, ref MatrixD, out Vector4D)

Transforms a Vector2 by the given Matrix.

Declaration
public static void Transform(ref Vector2 position, ref MatrixD matrix, out Vector4D result)
Parameters
Type Name Description
Vector2 position

The source Vector2.

MatrixD matrix

The transformation Matrix.

Vector4D result

[OutAttribute] The Vector4 resulting from the transformation.

Transform(ref Vector2, ref Quaternion, out Vector4D)

Transforms a Vector2 by a specified Quaternion into a Vector4.

Declaration
public static void Transform(ref Vector2 value, ref Quaternion rotation, out Vector4D result)
Parameters
Type Name Description
Vector2 value

The Vector2 to transform.

Quaternion rotation

The Quaternion rotation to apply.

Vector4D result

[OutAttribute] The Vector4 resulting from the transformation.

Transform(Vector3D, MatrixD)

Transforms a Vector3 by the given Matrix.

Declaration
public static Vector4D Transform(Vector3D position, MatrixD matrix)
Parameters
Type Name Description
Vector3D position

The source Vector3.

MatrixD matrix

The transformation Matrix.

Returns
Type Description
Vector4D

Transform(Vector3D, Quaternion)

Transforms a Vector3 by a specified Quaternion into a Vector4.

Declaration
public static Vector4D Transform(Vector3D value, Quaternion rotation)
Parameters
Type Name Description
Vector3D value

The Vector3 to transform.

Quaternion rotation

The Quaternion rotation to apply.

Returns
Type Description
Vector4D

Transform(ref Vector3D, ref MatrixD, out Vector4D)

Transforms a Vector3 by the given Matrix.

Declaration
public static void Transform(ref Vector3D position, ref MatrixD matrix, out Vector4D result)
Parameters
Type Name Description
Vector3D position

The source Vector3.

MatrixD matrix

The transformation Matrix.

Vector4D result

[OutAttribute] The Vector4 resulting from the transformation.

Transform(ref Vector3D, ref Quaternion, out Vector4D)

Transforms a Vector3 by a specified Quaternion into a Vector4.

Declaration
public static void Transform(ref Vector3D value, ref Quaternion rotation, out Vector4D result)
Parameters
Type Name Description
Vector3D value

The Vector3 to transform.

Quaternion rotation

The Quaternion rotation to apply.

Vector4D result

[OutAttribute] The Vector4 resulting from the transformation.

Transform(Vector4D, MatrixD)

Transforms a Vector4 by the specified Matrix.

Declaration
public static Vector4D Transform(Vector4D vector, MatrixD matrix)
Parameters
Type Name Description
Vector4D vector

The source Vector4.

MatrixD matrix

The transformation Matrix.

Returns
Type Description
Vector4D

Transform(Vector4D, Quaternion)

Transforms a Vector4 by a specified Quaternion.

Declaration
public static Vector4D Transform(Vector4D value, Quaternion rotation)
Parameters
Type Name Description
Vector4D value

The Vector4 to transform.

Quaternion rotation

The Quaternion rotation to apply.

Returns
Type Description
Vector4D

Transform(ref Vector4D, ref MatrixD, out Vector4D)

Transforms a Vector4 by the given Matrix.

Declaration
public static void Transform(ref Vector4D vector, ref MatrixD matrix, out Vector4D result)
Parameters
Type Name Description
Vector4D vector

The source Vector4.

MatrixD matrix

The transformation Matrix.

Vector4D result

[OutAttribute] The Vector4 resulting from the transformation.

Transform(ref Vector4D, ref Quaternion, out Vector4D)

Transforms a Vector4 by a specified Quaternion.

Declaration
public static void Transform(ref Vector4D value, ref Quaternion rotation, out Vector4D result)
Parameters
Type Name Description
Vector4D value

The Vector4 to transform.

Quaternion rotation

The Quaternion rotation to apply.

Vector4D result

[OutAttribute] The Vector4 resulting from the transformation.

Transform(Vector4D[], Int32, ref MatrixD, Vector4D[], Int32, Int32)

Transforms a specified range in an array of Vector4s by a specified Matrix into a specified range in a destination array.

Declaration
public static void Transform(Vector4D[] sourceArray, int sourceIndex, ref MatrixD matrix, Vector4D[] destinationArray, int destinationIndex, int length)
Parameters
Type Name Description
Vector4D[] sourceArray

The array of Vector4s containing the range to transform.

System.Int32 sourceIndex

The index in the source array of the first Vector4 to transform.

MatrixD matrix

The transform Matrix to apply.

Vector4D[] destinationArray

The existing destination array of Vector4s into which to write the results.

System.Int32 destinationIndex

The index in the destination array of the first result Vector4 to write.

System.Int32 length

The number of Vector4s to transform.

Transform(Vector4D[], Int32, ref Quaternion, Vector4D[], Int32, Int32)

Transforms a specified range in an array of Vector4s by a specified Quaternion into a specified range in a destination array.

Declaration
public static void Transform(Vector4D[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector4D[] destinationArray, int destinationIndex, int length)
Parameters
Type Name Description
Vector4D[] sourceArray

The array of Vector4s containing the range to transform.

System.Int32 sourceIndex

The index in the source array of the first Vector4 to transform.

Quaternion rotation

The Quaternion rotation to apply.

Vector4D[] destinationArray

The existing destination array of Vector4s into which to write the results.

System.Int32 destinationIndex

The index in the destination array of the first result Vector4 to write.

System.Int32 length

The number of Vector4s to transform.

Transform(Vector4D[], ref MatrixD, Vector4D[])

Transforms an array of Vector4s by a specified Matrix.

Declaration
public static void Transform(Vector4D[] sourceArray, ref MatrixD matrix, Vector4D[] destinationArray)
Parameters
Type Name Description
Vector4D[] sourceArray

The array of Vector4s to transform.

MatrixD matrix

The transform Matrix to apply.

Vector4D[] destinationArray

The existing destination array into which the transformed Vector4s are written.

Transform(Vector4D[], ref Quaternion, Vector4D[])

Transforms an array of Vector4s by a specified Quaternion.

Declaration
public static void Transform(Vector4D[] sourceArray, ref Quaternion rotation, Vector4D[] destinationArray)
Parameters
Type Name Description
Vector4D[] sourceArray

The array of Vector4s to transform.

Quaternion rotation

The Quaternion rotation to apply.

Vector4D[] destinationArray

The existing destination array into which the transformed Vector4s are written.

UnpackOrthoMatrix(ref Vector4D)

Declaration
public static MatrixD UnpackOrthoMatrix(ref Vector4D packed)
Parameters
Type Name Description
Vector4D packed
Returns
Type Description
MatrixD

Operators

Addition(Vector4D, Vector4D)

Adds two vectors.

Declaration
public static Vector4D operator +(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

Returns
Type Description
Vector4D

Division(Double, Vector4D)

Divides a vector by a scalar value.

Declaration
public static Vector4D operator /(double lhs, Vector4D rhs)
Parameters
Type Name Description
System.Double lhs

Source vector.

Vector4D rhs

The divisor.

Returns
Type Description
Vector4D

Division(Vector4D, Double)

Divides a vector by a scalar value.

Declaration
public static Vector4D operator /(Vector4D value1, double divider)
Parameters
Type Name Description
Vector4D value1

Source vector.

System.Double divider

The divisor.

Returns
Type Description
Vector4D

Division(Vector4D, Vector4D)

Divides the components of a vector by the components of another vector.

Declaration
public static Vector4D operator /(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Divisor vector.

Returns
Type Description
Vector4D

Equality(Vector4D, Vector4D)

Tests vectors for equality.

Declaration
public static bool operator ==(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

Returns
Type Description
System.Boolean

Implicit(Vector4 to Vector4D)

Declaration
public static implicit operator Vector4D(Vector4 v)
Parameters
Type Name Description
Vector4 v
Returns
Type Description
Vector4D

Implicit(Vector4D to Vector4)

Declaration
public static implicit operator Vector4(Vector4D v)
Parameters
Type Name Description
Vector4D v
Returns
Type Description
Vector4

Inequality(Vector4D, Vector4D)

Tests vectors for inequality.

Declaration
public static bool operator !=(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Vector to compare.

Vector4D value2

Vector to compare.

Returns
Type Description
System.Boolean

Multiply(Double, Vector4D)

Multiplies a vector by a scalar.

Declaration
public static Vector4D operator *(double scaleFactor, Vector4D value1)
Parameters
Type Name Description
System.Double scaleFactor

Scalar value.

Vector4D value1

Source vector.

Returns
Type Description
Vector4D

Multiply(Vector4D, Double)

Multiplies a vector by a scalar.

Declaration
public static Vector4D operator *(Vector4D value1, double scaleFactor)
Parameters
Type Name Description
Vector4D value1

Source vector.

System.Double scaleFactor

Scalar value.

Returns
Type Description
Vector4D

Multiply(Vector4D, Vector4D)

Multiplies the components of two vectors by each other.

Declaration
public static Vector4D operator *(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

Returns
Type Description
Vector4D

Subtraction(Vector4D, Vector4D)

Subtracts a vector from a vector.

Declaration
public static Vector4D operator -(Vector4D value1, Vector4D value2)
Parameters
Type Name Description
Vector4D value1

Source vector.

Vector4D value2

Source vector.

Returns
Type Description
Vector4D

UnaryNegation(Vector4D)

Returns a vector pointing in the opposite direction.

Declaration
public static Vector4D operator -(Vector4D value)
Parameters
Type Name Description
Vector4D value

Source vector.

Returns
Type Description
Vector4D
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾