Struct Vector3
Represents a three dimensional mathematical vector.
Implements
Inherited Members
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
public struct Vector3 : IEquatable<Vector3>, IFormattable
Constructors
Vector3(Vector2, Single)
Initializes a new instance of the Vector3 struct.
Declaration
public Vector3(Vector2 value, float z)
Parameters
Vector2
value
A vector containing the values with which to initialize the X and Y components. 
System.Single
z
Initial value for the Z component of the vector. 
Vector3(Vector4)
Initializes a new instance of the Vector3 struct.
Declaration
public Vector3(Vector4 value)
Parameters
Vector4
value
A vector containing the values with which to initialize the X, Y and Z components. 
Vector3(Single)
Initializes a new instance of the Vector3 struct.
Declaration
public Vector3(float value)
Parameters
System.Single
value
The value that will be assigned to all components. 
Vector3(Single, Single, Single)
Initializes a new instance of the Vector3 struct.
Declaration
public Vector3(float x, float y, float z)
Parameters
System.Single
x
Initial value for the X component of the vector. 
System.Single
y
Initial value for the Y component of the vector. 
System.Single
z
Initial value for the Z component of the vector. 
Vector3(Single[])
Initializes a new instance of the Vector3 struct.
Declaration
public Vector3(float[] values)
Parameters
System.Single[]
values
The values to assign to the X, Y, and Z components of the vector. This must be an array with three elements. 
Exceptions
System.ArgumentNullException
Thrown when 
System.ArgumentOutOfRangeException
Thrown when 
Fields
Backward
A unit Vector3 designating backward in a lefthanded coordinate system (0, 0, 1).
Declaration
public static readonly Vector3 Backward
Field Value
Vector3

Down
A unit Vector3 designating down (0, 1, 0).
Declaration
public static readonly Vector3 Down
Field Value
Vector3

Forward
A unit Vector3 designating forward in a lefthanded coordinate system (0, 0, 1).
Declaration
public static readonly Vector3 Forward
Field Value
Vector3

Half
A Vector3 with all of its components set to half.
Declaration
public static readonly Vector3 Half
Field Value
Vector3

Left
A unit Vector3 designating left (1, 0, 0).
Declaration
public static readonly Vector3 Left
Field Value
Vector3

Maximum
A Vector3 with all components equal to System.Single.MaxValue.
Declaration
public static readonly Vector3 Maximum
Field Value
Vector3

Minimum
A Vector3 with all components equal to System.Single.MinValue.
Declaration
public static readonly Vector3 Minimum
Field Value
Vector3

One
A Vector3 with all of its components set to one.
Declaration
public static readonly Vector3 One
Field Value
Vector3

Right
A unit Vector3 designating right (1, 0, 0).
Declaration
public static readonly Vector3 Right
Field Value
Vector3

SizeInBytes
The size of the Vector3 type, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
System.Int32

UnitX
UnitY
UnitZ
Up
A unit Vector3 designating up (0, 1, 0).
Declaration
public static readonly Vector3 Up
Field Value
Vector3

X
The X component of the vector.
Declaration
public float X
Field Value
System.Single

Y
The Y component of the vector.
Declaration
public float Y
Field Value
System.Single

Z
The Z component of the vector.
Declaration
public float Z
Field Value
System.Single

Zero
A Vector3 with all of its components set to zero.
Declaration
public static readonly Vector3 Zero
Field Value
Vector3

Properties
AvgValue
Gets an arithmetic average value of all vector components.
Declaration
public float AvgValue { get; }
Property Value
System.Single

IsNormalized
Gets a value indicting whether this instance is normalized.
Declaration
public bool IsNormalized { get; }
Property Value
System.Boolean

IsOne
Gets a value indicting whether this vector is one
Declaration
public bool IsOne { get; }
Property Value
System.Boolean

IsZero
Gets a value indicting whether this vector is zero
Declaration
public bool IsZero { get; }
Property Value
System.Boolean

Item[Int32]
Gets or sets the component at the specified index.
Declaration
public float this[int index] { get; set; }
Parameters
System.Int32
index
The index of the component to access. Use 0 for the X component, 1 for the Y component, and 2 for the Z component. 
Property Value
System.Single
The value of the X, Y, or Z component, depending on the index. 
Exceptions
System.ArgumentOutOfRangeException
Thrown when the 
Length
Calculates the length of the vector.
Declaration
public float Length { get; }
Property Value
System.Single
The length of the vector. 
Remarks
LengthSquared may be preferred when only the relative length is needed and speed is of the essence.
LengthSquared
Calculates the squared length of the vector.
Declaration
public float LengthSquared { get; }
Property Value
System.Single
The squared length of the vector. 
Remarks
This method may be preferred to Length when only a relative length is needed and speed is of the essence.
MaxValue
Gets a maximum component value
Declaration
public float MaxValue { get; }
Property Value
System.Single

MinValue
Gets a minimum component value
Declaration
public float MinValue { get; }
Property Value
System.Single

Normalized
Gets the normalized vector. Returned vector has length equal 1.
Declaration
public Vector3 Normalized { get; }
Property Value
Vector3

ValuesSum
Gets a sum of the component values.
Declaration
public float ValuesSum { get; }
Property Value
System.Single

Methods
Abs(Vector3)
Returns the absolute value of a vector.
Declaration
public static Vector3 Abs(Vector3 v)
Parameters
Vector3
v
The value. 
Returns
Vector3
A vector which components are less or equal to 0. 
Add(Vector3, Vector3)
Adds two vectors.
Declaration
public static Vector3 Add(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first vector to add. 
Vector3
right
The second vector to add. 
Returns
Vector3
The sum of the two vectors. 
Add(Vector3, Single)
Perform a componentwise addition
Declaration
public static Vector3 Add(Vector3 left, float right)
Parameters
Vector3
left
The input vector 
System.Single
right
The scalar value to be added to elements 
Returns
Vector3
The vector with added scalar for each element. 
Add(ref Vector3, ref Vector3, out Vector3)
Adds two vectors.
Declaration
public static void Add(ref Vector3 left, ref Vector3 right, out Vector3 result)
Parameters
Vector3
left
The first vector to add. 
Vector3
right
The second vector to add. 
Vector3
result
When the method completes, contains the sum of the two vectors. 
Add(ref Vector3, ref Single, out Vector3)
Perform a componentwise addition
Declaration
public static void Add(ref Vector3 left, ref float right, out Vector3 result)
Parameters
Vector3
left
The input vector 
System.Single
right
The scalar value to be added to elements 
Vector3
result
The vector with added scalar for each element. 
Angle(Vector3, Vector3)
Calculates the angle (in degrees) between from
and to
. This is always the smallest value.
Declaration
public static float Angle(Vector3 from, Vector3 to)
Parameters
Vector3
from
The first vector. 
Vector3
to
The second vector. 
Returns
System.Single
The angle (in degrees). 
Barycentric(Vector3, Vector3, Vector3, Single, Single)
Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
Declaration
public static Vector3 Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, float amount1, float amount2)
Parameters
Vector3
value1
A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle. 
Vector3
value2
A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle. 
Vector3
value3
A Vector3 containing the 3D Cartesian coordinates of vertex 3 of the triangle. 
System.Single
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in

System.Single
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in

Returns
Vector3
A new Vector3 containing the 3D Cartesian coordinates of the specified point. 
Barycentric(ref Vector3, ref Vector3, ref Vector3, Single, Single, out Vector3)
Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
Declaration
public static void Barycentric(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, float amount1, float amount2, out Vector3 result)
Parameters
Vector3
value1
A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle. 
Vector3
value2
A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle. 
Vector3
value3
A Vector3 containing the 3D Cartesian coordinates of vertex 3 of the triangle. 
System.Single
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in

System.Single
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in

Vector3
result
When the method completes, contains the 3D Cartesian coordinates of the specified point. 
CatmullRom(Vector3, Vector3, Vector3, Vector3, Single)
Performs a CatmullRom interpolation using the specified positions.
Declaration
public static Vector3 CatmullRom(Vector3 value1, Vector3 value2, Vector3 value3, Vector3 value4, float amount)
Parameters
Vector3
value1
The first position in the interpolation. 
Vector3
value2
The second position in the interpolation. 
Vector3
value3
The third position in the interpolation. 
Vector3
value4
The fourth position in the interpolation. 
System.Single
amount
Weighting factor. 
Returns
Vector3
A vector that is the result of the CatmullRom interpolation. 
CatmullRom(ref Vector3, ref Vector3, ref Vector3, ref Vector3, Single, out Vector3)
Performs a CatmullRom interpolation using the specified positions.
Declaration
public static void CatmullRom(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, ref Vector3 value4, float amount, out Vector3 result)
Parameters
Vector3
value1
The first position in the interpolation. 
Vector3
value2
The second position in the interpolation. 
Vector3
value3
The third position in the interpolation. 
Vector3
value4
The fourth position in the interpolation. 
System.Single
amount
Weighting factor. 
Vector3
result
When the method completes, contains the result of the CatmullRom interpolation. 
Clamp(Vector3, Vector3, Vector3)
Restricts a value to be within a specified range.
Declaration
public static Vector3 Clamp(Vector3 value, Vector3 min, Vector3 max)
Parameters
Vector3
value
The value to clamp. 
Vector3
min
The minimum value. 
Vector3
max
The maximum value. 
Returns
Vector3
The clamped value. 
Clamp(ref Vector3, ref Vector3, ref Vector3, out Vector3)
Restricts a value to be within a specified range.
Declaration
public static void Clamp(ref Vector3 value, ref Vector3 min, ref Vector3 max, out Vector3 result)
Parameters
Vector3
value
The value to clamp. 
Vector3
min
The minimum value. 
Vector3
max
The maximum value. 
Vector3
result
When the method completes, contains the clamped value. 
Cross(Vector3, Vector3)
Calculates the cross product of two vectors.
Declaration
public static Vector3 Cross(Vector3 left, Vector3 right)
Parameters
Vector3
left
First source vector. 
Vector3
right
Second source vector. 
Returns
Vector3
The cross product of the two vectors. 
Cross(ref Vector3, ref Vector3, out Vector3)
Calculates the cross product of two vectors.
Declaration
public static void Cross(ref Vector3 left, ref Vector3 right, out Vector3 result)
Parameters
Vector3
left
First source vector. 
Vector3
right
Second source vector. 
Vector3
result
When the method completes, contains he cross product of the two vectors. 
Distance(Vector3, Vector3)
Calculates the distance between two vectors.
Declaration
public static float Distance(Vector3 value1, Vector3 value2)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
Returns
System.Single
The distance between the two vectors. 
Remarks
DistanceSquared(Vector3, Vector3) may be preferred when only the relative distance is needed and speed is of the essence.
Distance(ref Vector3, ref Vector3)
Calculates the distance between two vectors.
Declaration
public static float Distance(ref Vector3 value1, ref Vector3 value2)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
Returns
System.Single
The distance between the two vectors. 
Remarks
DistanceSquared(ref Vector3, ref Vector3, out Single) may be preferred when only the relative distance is needed and speed is of the essence.
Distance(ref Vector3, ref Vector3, out Single)
Calculates the distance between two vectors.
Declaration
public static void Distance(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
System.Single
result
When the method completes, contains the distance between the two vectors. 
Remarks
DistanceSquared(ref Vector3, ref Vector3, out Single) may be preferred when only the relative distance is needed and speed is of the essence.
DistanceSquared(Vector3, Vector3)
Calculates the squared distance between two vectors.
Declaration
public static float DistanceSquared(Vector3 value1, Vector3 value2)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
Returns
System.Single
The squared distance between the two vectors. 
Remarks
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.
DistanceSquared(ref Vector3, ref Vector3)
Calculates the squared distance between two vectors.
Declaration
public static float DistanceSquared(ref Vector3 value1, ref Vector3 value2)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
Returns
System.Single
The squared distance between the two vectors. 
Remarks
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.
DistanceSquared(ref Vector3, ref Vector3, out Single)
Calculates the squared distance between two vectors.
Declaration
public static void DistanceSquared(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
System.Single
result
When the method completes, contains the squared distance between the two vectors. 
Remarks
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.
DistanceXY(ref Vector3, ref Vector3, out Single)
Calculates the distance between two vectors on the XY plane (ignoring Z).
Declaration
public static void DistanceXY(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
System.Single
result
When the method completes, contains the distance between the two vectors in the XY plane. 
DistanceXYSquared(ref Vector3, ref Vector3, out Single)
Calculates the squared distance between two vectors on the XY plane (ignoring Z).
Declaration
public static void DistanceXYSquared(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector 
System.Single
result
When the method completes, contains the squared distance between the two vectors in the XY plane. 
DistanceXZ(ref Vector3, ref Vector3, out Single)
Calculates the distance between two vectors on the XZ plane (ignoring Y).
Declaration
public static void DistanceXZ(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
System.Single
result
When the method completes, contains the distance between the two vectors in the XY plane. 
DistanceXZSquared(ref Vector3, ref Vector3, out Single)
Calculates the squared distance between two vectors on the XZ plane (ignoring Y).
Declaration
public static void DistanceXZSquared(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector 
System.Single
result
When the method completes, contains the squared distance between the two vectors in the XY plane. 
DistanceYZ(ref Vector3, ref Vector3, out Single)
Calculates the distance between two vectors on the YZ plane (ignoring X).
Declaration
public static void DistanceYZ(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector. 
System.Single
result
When the method completes, contains the distance between the two vectors in the YZ plane. 
DistanceYZSquared(ref Vector3, ref Vector3, out Single)
Calculates the squared distance between two vectors on the YZ plane (ignoring X).
Declaration
public static void DistanceYZSquared(ref Vector3 value1, ref Vector3 value2, out float result)
Parameters
Vector3
value1
The first vector. 
Vector3
value2
The second vector 
System.Single
result
When the method completes, contains the squared distance between the two vectors in the YZ plane. 
Divide(Vector3, Vector3)
Divies a vector by the given value.
Declaration
public static Vector3 Divide(Vector3 value, Vector3 scale)
Parameters
Vector3
value
The vector to scale. 
Vector3
scale
The amount by which to scale the vector (per component). 
Returns
Vector3
The divided vector. 
Divide(Vector3, Single)
Scales a vector by the given value.
Declaration
public static Vector3 Divide(Vector3 value, float scale)
Parameters
Vector3
value
The vector to scale. 
System.Single
scale
The amount by which to scale the vector. 
Returns
Vector3
The scaled vector. 
Divide(ref Vector3, ref Vector3, out Vector3)
Divides a vector by the given value.
Declaration
public static void Divide(ref Vector3 value, ref Vector3 scale, out Vector3 result)
Parameters
Vector3
value
The vector to scale. 
Vector3
scale
The amount by which to scale the vector (per component). 
Vector3
result
When the method completes, contains the divided vector. 
Divide(ref Vector3, Single, out Vector3)
Scales a vector by the given value.
Declaration
public static void Divide(ref Vector3 value, float scale, out Vector3 result)
Parameters
Vector3
value
The vector to scale. 
System.Single
scale
The amount by which to scale the vector. 
Vector3
result
When the method completes, contains the scaled vector. 
Divide(Single, Vector3)
Scales a vector by the given value.
Declaration
public static Vector3 Divide(float scale, Vector3 value)
Parameters
System.Single
scale
The amount by which to scale the vector. 
Vector3
value
The vector to scale. 
Returns
Vector3
The scaled vector. 
Divide(Single, ref Vector3, out Vector3)
Scales a vector by the given value.
Declaration
public static void Divide(float scale, ref Vector3 value, out Vector3 result)
Parameters
System.Single
scale
The amount by which to scale the vector. 
Vector3
value
The vector to scale. 
Vector3
result
When the method completes, contains the scaled vector. 
Dot(Vector3, Vector3)
Calculates the dot product of two vectors.
Declaration
public static float Dot(Vector3 left, Vector3 right)
Parameters
Vector3
left
First source vector. 
Vector3
right
Second source vector. 
Returns
System.Single
The dot product of the two vectors. 
Dot(ref Vector3, ref Vector3)
Calculates the dot product of two vectors.
Declaration
public static float Dot(ref Vector3 left, ref Vector3 right)
Parameters
Vector3
left
First source vector. 
Vector3
right
Second source vector. 
Returns
System.Single
The dot product of the two vectors. 
Dot(ref Vector3, ref Vector3, out Single)
Calculates the dot product of two vectors.
Declaration
public static void Dot(ref Vector3 left, ref Vector3 right, out float result)
Parameters
Vector3
left
First source vector. 
Vector3
right
Second source vector. 
System.Single
result
When the method completes, contains the dot product of the two vectors. 
Equals(Vector3)
Determines whether the specified Vector3 is equal to this instance.
Declaration
public bool Equals(Vector3 other)
Parameters
Vector3
other
The Vector3 to compare with this instance. 
Returns
System.Boolean

Implements
Equals(ref Vector3)
Determines whether the specified Vector3 is equal to this instance.
Declaration
public bool Equals(ref Vector3 other)
Parameters
Vector3
other
The Vector3 to compare with this instance. 
Returns
System.Boolean

Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object value)
Parameters
System.Object
value
The System.Object to compare with this instance. 
Returns
System.Boolean

Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
Overrides
Hermite(Vector3, Vector3, Vector3, Vector3, Single)
Performs a Hermite spline interpolation.
Declaration
public static Vector3 Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float amount)
Parameters
Vector3
value1
First source position vector. 
Vector3
tangent1
First source tangent vector. 
Vector3
value2
Second source position vector. 
Vector3
tangent2
Second source tangent vector. 
System.Single
amount
Weighting factor. 
Returns
Vector3
The result of the Hermite spline interpolation. 
Hermite(ref Vector3, ref Vector3, ref Vector3, ref Vector3, Single, out Vector3)
Performs a Hermite spline interpolation.
Declaration
public static void Hermite(ref Vector3 value1, ref Vector3 tangent1, ref Vector3 value2, ref Vector3 tangent2, float amount, out Vector3 result)
Parameters
Vector3
value1
First source position vector. 
Vector3
tangent1
First source tangent vector. 
Vector3
value2
Second source position vector. 
Vector3
tangent2
Second source tangent vector. 
System.Single
amount
Weighting factor. 
Vector3
result
When the method completes, contains the result of the Hermite spline interpolation. 
Lerp(Vector3, Vector3, Single)
Performs a linear interpolation between two vectors.
Declaration
public static Vector3 Lerp(Vector3 start, Vector3 end, float amount)
Parameters
Vector3
start
Start vector. 
Vector3
end
End vector. 
System.Single
amount
Value between 0 and 1 indicating the weight of 
Returns
Vector3
The linear interpolation of the two vectors. 
Remarks
Passing amount
a value of 0 will cause start
to be returned; a value of 1
will cause end
to be returned.
Lerp(ref Vector3, ref Vector3, Single, out Vector3)
Performs a linear interpolation between two vectors.
Declaration
public static void Lerp(ref Vector3 start, ref Vector3 end, float amount, out Vector3 result)
Parameters
Vector3
start
Start vector. 
Vector3
end
End vector. 
System.Single
amount
Value between 0 and 1 indicating the weight of 
Vector3
result
When the method completes, contains the linear interpolation of the two vectors. 
Remarks
Passing amount
a value of 0 will cause start
to be returned; a value of 1
will cause end
to be returned.
Max(Vector3, Vector3)
Returns a vector containing the largest components of the specified vectors.
Declaration
public static Vector3 Max(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first source vector. 
Vector3
right
The second source vector. 
Returns
Vector3
A vector containing the largest components of the source vectors. 
Max(ref Vector3, ref Vector3, out Vector3)
Returns a vector containing the largest components of the specified vectors.
Declaration
public static void Max(ref Vector3 left, ref Vector3 right, out Vector3 result)
Parameters
Vector3
left
The first source vector. 
Vector3
right
The second source vector. 
Vector3
result
When the method completes, contains an new vector composed of the largest components of the source vectors. 
Min(Vector3, Vector3)
Returns a vector containing the smallest components of the specified vectors.
Declaration
public static Vector3 Min(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first source vector. 
Vector3
right
The second source vector. 
Returns
Vector3
A vector containing the smallest components of the source vectors. 
Min(ref Vector3, ref Vector3, out Vector3)
Returns a vector containing the smallest components of the specified vectors.
Declaration
public static void Min(ref Vector3 left, ref Vector3 right, out Vector3 result)
Parameters
Vector3
left
The first source vector. 
Vector3
right
The second source vector. 
Vector3
result
When the method completes, contains an new vector composed of the smallest components of the source vectors. 
Multiply(Vector3, Vector3)
Multiply a vector with another by performing componentwise multiplication.
Declaration
public static Vector3 Multiply(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first vector to Multiply. 
Vector3
right
The second vector to multiply. 
Returns
Vector3
The multiplied vector. 
Multiply(Vector3, Single)
Scales a vector by the given value.
Declaration
public static Vector3 Multiply(Vector3 value, float scale)
Parameters
Vector3
value
The vector to scale. 
System.Single
scale
The amount by which to scale the vector. 
Returns
Vector3
The scaled vector. 
Multiply(ref Vector3, ref Vector3, out Vector3)
Multiply a vector with another by performing componentwise multiplication.
Declaration
public static void Multiply(ref Vector3 left, ref Vector3 right, out Vector3 result)
Parameters
Vector3
left
The first vector to multiply. 
Vector3
right
The second vector to multiply. 
Vector3
result
When the method completes, contains the multiplied vector. 
Multiply(ref Vector3, Single, out Vector3)
Scales a vector by the given value.
Declaration
public static void Multiply(ref Vector3 value, float scale, out Vector3 result)
Parameters
Vector3
value
The vector to scale. 
System.Single
scale
The amount by which to scale the vector. 
Vector3
result
When the method completes, contains the scaled vector. 
NearEqual(Vector3, Vector3, Single)
Tests whether one vector is near another vector.
Declaration
public static bool NearEqual(Vector3 left, Vector3 right, float epsilon = 1E06F)
Parameters
Vector3
left
The left vector. 
Vector3
right
The right vector. 
System.Single
epsilon
The epsilon. 
Returns
System.Boolean

NearEqual(ref Vector3, ref Vector3, Single)
Tests whether one vector is near another vector.
Declaration
public static bool NearEqual(ref Vector3 left, ref Vector3 right, float epsilon = 1E06F)
Parameters
Vector3
left
The left vector. 
Vector3
right
The right vector. 
System.Single
epsilon
The epsilon. 
Returns
System.Boolean

Negate()
Reverses the direction of the vector.
Declaration
public void Negate()
Negate(Vector3)
Reverses the direction of a given vector.
Declaration
public static Vector3 Negate(Vector3 value)
Parameters
Vector3
value
The vector to negate. 
Returns
Vector3
A vector facing in the opposite direction. 
Negate(ref Vector3, out Vector3)
Reverses the direction of a given vector.
Declaration
public static void Negate(ref Vector3 value, out Vector3 result)
Parameters
Vector3
value
The vector to negate. 
Vector3
result
When the method completes, contains a vector facing in the opposite direction. 
Normalize()
Converts the vector into a unit vector.
Declaration
public void Normalize()
Normalize(Vector3)
Converts the vector into a unit vector.
Declaration
public static Vector3 Normalize(Vector3 value)
Parameters
Vector3
value
The vector to normalize. 
Returns
Vector3
The normalized vector. 
Normalize(ref Vector3, out Vector3)
Converts the vector into a unit vector.
Declaration
public static void Normalize(ref Vector3 value, out Vector3 result)
Parameters
Vector3
value
The vector to normalize. 
Vector3
result
When the method completes, contains the normalized vector. 
Orthogonalize(Vector3[], Vector3[])
Orthogonalizes a list of vectors.
Declaration
public static void Orthogonalize(Vector3[] destination, params Vector3[] source)
Parameters
Vector3[]
destination
The list of orthogonalized vectors. 
Vector3[]
source
The list of vectors to orthogonalize. 
Remarks
Orthogonalization is the process of making all vectors orthogonal to each other. This means that any given vector in the list will be orthogonal to any other given vector in the list.
Because this method uses the modified GramSchmidt process, the resulting vectors tend to be numerically unstable. The numeric stability decreases according to the vectors position in the list so that the first vector is the most stable and the last vector is the least stable.
Exceptions
System.ArgumentNullException
Thrown when 
System.ArgumentOutOfRangeException
Thrown when 
Orthonormalize(Vector3[], Vector3[])
Orthonormalizes a list of vectors.
Declaration
public static void Orthonormalize(Vector3[] destination, params Vector3[] source)
Parameters
Vector3[]
destination
The list of orthonormalized vectors. 
Vector3[]
source
The list of vectors to orthonormalize. 
Remarks
Orthonormalization is the process of making all vectors orthogonal to each other and making all vectors of unit length. This means that any given vector will be orthogonal to any other given vector in the list.
Because this method uses the modified GramSchmidt process, the resulting vectors tend to be numerically unstable. The numeric stability decreases according to the vectors position in the list so that the first vector is the most stable and the last vector is the least stable.
Exceptions
System.ArgumentNullException
Thrown when 
System.ArgumentOutOfRangeException
Thrown when 
Project(Vector3, Vector3)
Projects a vector onto another vector.
Declaration
public static Vector3 Project(Vector3 vector, Vector3 onNormal)
Parameters
Vector3
vector
The vector to project. 
Vector3
onNormal
The projection normal vector. 
Returns
Vector3
The projected vector. 
Project(Vector3, Single, Single, Single, Single, Single, Single, Matrix)
Projects a 3D vector from object space into screen space.
Declaration
public static Vector3 Project(Vector3 vector, float x, float y, float width, float height, float minZ, float maxZ, Matrix worldViewProjection)
Parameters
Vector3
vector
The vector to project. 
System.Single
x
The X position of the viewport. 
System.Single
y
The Y position of the viewport. 
System.Single
width
The width of the viewport. 
System.Single
height
The height of the viewport. 
System.Single
minZ
The minimum depth of the viewport. 
System.Single
maxZ
The maximum depth of the viewport. 
Matrix
worldViewProjection
The combined worldviewprojection matrix. 
Returns
Vector3
The vector in screen space. 
Project(ref Vector3, Single, Single, Single, Single, Single, Single, ref Matrix, out Vector3)
Projects a 3D vector from object space into screen space.
Declaration
public static void Project(ref Vector3 vector, float x, float y, float width, float height, float minZ, float maxZ, ref Matrix worldViewProjection, out Vector3 result)
Parameters
Vector3
vector
The vector to project. 
System.Single
x
The X position of the viewport. 
System.Single
y
The Y position of the viewport. 
System.Single
width
The width of the viewport. 
System.Single
height
The height of the viewport. 
System.Single
minZ
The minimum depth of the viewport. 
System.Single
maxZ
The maximum depth of the viewport. 
Matrix
worldViewProjection
The combined worldviewprojection matrix. 
Vector3
result
When the method completes, contains the vector in screen space. 
ProjectOnPlane(Vector3, Vector3)
Projects a vector onto a plane defined by a normal orthogonal to the plane.
Declaration
public static Vector3 ProjectOnPlane(Vector3 vector, Vector3 planeNormal)
Parameters
Vector3
vector
The vector to project. 
Vector3
planeNormal
The plane normal vector. 
Returns
Vector3
The projected vector. 
Reflect(Vector3, Vector3)
Returns the reflection of a vector off a surface that has the specified normal.
Declaration
public static Vector3 Reflect(Vector3 vector, Vector3 normal)
Parameters
Vector3
vector
The source vector. 
Vector3
normal
Normal of the surface. 
Returns
Vector3
The reflected vector. 
Remarks
Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was close enough to the surface to hit it.
Reflect(ref Vector3, ref Vector3, out Vector3)
Returns the reflection of a vector off a surface that has the specified normal.
Declaration
public static void Reflect(ref Vector3 vector, ref Vector3 normal, out Vector3 result)
Parameters
Vector3
vector
The source vector. 
Vector3
normal
Normal of the surface. 
Vector3
result
When the method completes, contains the reflected vector. 
Remarks
Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was close enough to the surface to hit it.
SmoothStep(Vector3, Vector3, Single)
Performs a cubic interpolation between two vectors.
Declaration
public static Vector3 SmoothStep(Vector3 start, Vector3 end, float amount)
Parameters
Vector3
start
Start vector. 
Vector3
end
End vector. 
System.Single
amount
Value between 0 and 1 indicating the weight of 
Returns
Vector3
The cubic interpolation of the two vectors. 
SmoothStep(ref Vector3, ref Vector3, Single, out Vector3)
Performs a cubic interpolation between two vectors.
Declaration
public static void SmoothStep(ref Vector3 start, ref Vector3 end, float amount, out Vector3 result)
Parameters
Vector3
start
Start vector. 
Vector3
end
End vector. 
System.Single
amount
Value between 0 and 1 indicating the weight of 
Vector3
result
When the method completes, contains the cubic interpolation of the two vectors. 
Subtract(Vector3, Vector3)
Subtracts two vectors.
Declaration
public static Vector3 Subtract(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first vector to subtract. 
Vector3
right
The second vector to subtract. 
Returns
Vector3
The difference of the two vectors. 
Subtract(Vector3, Single)
Perform a componentwise subtraction
Declaration
public static Vector3 Subtract(Vector3 left, float right)
Parameters
Vector3
left
The input vector 
System.Single
right
The scalar value to be subtracted from elements 
Returns
Vector3
The vector with subtracted scalar for each element. 
Subtract(ref Vector3, ref Vector3, out Vector3)
Subtracts two vectors.
Declaration
public static void Subtract(ref Vector3 left, ref Vector3 right, out Vector3 result)
Parameters
Vector3
left
The first vector to subtract. 
Vector3
right
The second vector to subtract. 
Vector3
result
When the method completes, contains the difference of the two vectors. 
Subtract(ref Vector3, ref Single, out Vector3)
Perform a componentwise subtraction
Declaration
public static void Subtract(ref Vector3 left, ref float right, out Vector3 result)
Parameters
Vector3
left
The input vector 
System.Single
right
The scalar value to be subtracted from elements 
Vector3
result
The vector with subtracted scalar for each element. 
Subtract(Single, Vector3)
Perform a componentwise subtraction
Declaration
public static Vector3 Subtract(float left, Vector3 right)
Parameters
System.Single
left
The scalar value to be subtracted from elements 
Vector3
right
The input vector. 
Returns
Vector3
The vector with subtracted scalar for each element. 
Subtract(ref Single, ref Vector3, out Vector3)
Perform a componentwise subtraction
Declaration
public static void Subtract(ref float left, ref Vector3 right, out Vector3 result)
Parameters
System.Single
left
The scalar value to be subtracted from elements 
Vector3
right
The input vector. 
Vector3
result
The vector with subtracted scalar for each element. 
ToArray()
Creates an array containing the elements of the vector.
Declaration
public float[] ToArray()
Returns
System.Single[]
A threeelement array containing the components of the vector. 
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
System.String
A System.String that represents this instance. 
Overrides
ToString(IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
System.IFormatProvider
formatProvider
The format provider. 
Returns
System.String
A System.String that represents this instance. 
ToString(String)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format)
Parameters
System.String
format
The format. 
Returns
System.String
A System.String that represents this instance. 
ToString(String, IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
System.String
format
The format. 
System.IFormatProvider
formatProvider
The format provider. 
Returns
System.String
A System.String that represents this instance. 
Implements
Transform(Vector3, Matrix)
Transforms a 3D vector by the given Matrix.
Declaration
public static Vector3 Transform(Vector3 vector, Matrix transform)
Parameters
Vector3
vector
The source vector. 
Matrix
transform
The transformation Matrix. 
Returns
Vector3
The transformed Vector4. 
Transform(Vector3, Matrix3x3)
Transforms a 3D vector by the given Matrix3x3.
Declaration
public static Vector3 Transform(Vector3 vector, Matrix3x3 transform)
Parameters
Vector3
vector
The source vector. 
Matrix3x3
transform
The transformation Matrix3x3. 
Returns
Vector3
The transformed Vector3. 
Transform(Vector3, Quaternion)
Transforms a 3D vector by the given Quaternion rotation.
Declaration
public static Vector3 Transform(Vector3 vector, Quaternion rotation)
Parameters
Vector3
vector
The vector to rotate. 
Quaternion
rotation
The Quaternion rotation to apply. 
Returns
Vector3
The transformed Vector3. 
Transform(ref Vector3, ref Matrix, out Vector3)
Transforms a 3D vector by the given Matrix.
Declaration
public static void Transform(ref Vector3 vector, ref Matrix transform, out Vector3 result)
Parameters
Vector3
vector
The source vector. 
Matrix
transform
The transformation Matrix. 
Vector3
result
When the method completes, contains the transformed Vector3. 
Transform(ref Vector3, ref Matrix, out Vector4)
Transforms a 3D vector by the given Matrix.
Declaration
public static void Transform(ref Vector3 vector, ref Matrix transform, out Vector4 result)
Parameters
Vector3
vector
The source vector. 
Matrix
transform
The transformation Matrix. 
Vector4
result
When the method completes, contains the transformed Vector4. 
Transform(ref Vector3, ref Matrix3x3, out Vector3)
Transforms a 3D vector by the given Matrix3x3.
Declaration
public static void Transform(ref Vector3 vector, ref Matrix3x3 transform, out Vector3 result)
Parameters
Vector3
vector
The source vector. 
Matrix3x3
transform
The transformation Matrix3x3. 
Vector3
result
When the method completes, contains the transformed Vector3. 
Transform(ref Vector3, ref Quaternion, out Vector3)
Transforms a 3D vector by the given Quaternion rotation.
Declaration
public static void Transform(ref Vector3 vector, ref Quaternion rotation, out Vector3 result)
Parameters
Vector3
vector
The vector to rotate. 
Quaternion
rotation
The Quaternion rotation to apply. 
Vector3
result
When the method completes, contains the transformed Vector3. 
Transform(Vector3[], ref Matrix, Vector4[])
Transforms an array of 3D vectors by the given Matrix.
Declaration
public static void Transform(Vector3[] source, ref Matrix transform, Vector4[] destination)
Parameters
Vector3[]
source
The array of vectors to transform. 
Matrix
transform
The transformation Matrix. 
Vector4[]
destination
The array for which the transformed vectors are stored. 
Exceptions
System.ArgumentNullException
Thrown when 
System.ArgumentOutOfRangeException
Thrown when 
Transform(Vector3[], ref Quaternion, Vector3[])
Transforms an array of vectors by the given Quaternion rotation.
Declaration
public static void Transform(Vector3[] source, ref Quaternion rotation, Vector3[] destination)
Parameters
Vector3[]
source
The array of vectors to transform. 
Quaternion
rotation
The Quaternion rotation to apply. 
Vector3[]
destination
The array for which the transformed vectors are stored.
This array may be the same array as 
Exceptions
System.ArgumentNullException
Thrown when 
System.ArgumentOutOfRangeException
Thrown when 
TransformCoordinate(Vector3, Matrix)
Performs a coordinate transformation using the given Matrix.
Declaration
public static Vector3 TransformCoordinate(Vector3 coordinate, Matrix transform)
Parameters
Vector3
coordinate
The coordinate vector to transform. 
Matrix
transform
The transformation Matrix. 
Returns
Vector3
The transformed coordinates. 
Remarks
A coordinate transform performs the transformation with the assumption that the w component is one. The four dimensional vector obtained from the transformation operation has each component in the vector divided by the w component. This forces the w component to be one and therefore makes the vector homogeneous. The homogeneous vector is often preferred when working with coordinates as the w component can safely be ignored.
TransformCoordinate(ref Vector3, ref Matrix, out Vector3)
Performs a coordinate transformation using the given Matrix.
Declaration
public static void TransformCoordinate(ref Vector3 coordinate, ref Matrix transform, out Vector3 result)
Parameters
Vector3
coordinate
The coordinate vector to transform. 
Matrix
transform
The transformation Matrix. 
Vector3
result
When the method completes, contains the transformed coordinates. 
Remarks
A coordinate transform performs the transformation with the assumption that the w component is one. The four dimensional vector obtained from the transformation operation has each component in the vector divided by the w component. This forces the w component to be one and therefore makes the vector homogeneous. The homogeneous vector is often preferred when working with coordinates as the w component can safely be ignored.
TransformCoordinate(Vector3[], ref Matrix, Vector3[])
Performs a coordinate transformation on an array of vectors using the given Matrix.
Declaration
public static void TransformCoordinate(Vector3[] source, ref Matrix transform, Vector3[] destination)
Parameters
Vector3[]
source
The array of coordinate vectors to transform. 
Matrix
transform
The transformation Matrix. 
Vector3[]
destination
The array for which the transformed vectors are stored.
This array may be the same array as 
Remarks
A coordinate transform performs the transformation with the assumption that the w component is one. The four dimensional vector obtained from the transformation operation has each component in the vector divided by the w component. This forces the w component to be one and therefore makes the vector homogeneous. The homogeneous vector is often preferred when working with coordinates as the w component can safely be ignored.
Exceptions
System.ArgumentNullException
Thrown when 
System.ArgumentOutOfRangeException
Thrown when 
TransformNormal(Vector3, Matrix)
Performs a normal transformation using the given Matrix.
Declaration
public static Vector3 TransformNormal(Vector3 normal, Matrix transform)
Parameters
Vector3
normal
The normal vector to transform. 
Matrix
transform
The transformation Matrix. 
Returns
Vector3
The transformed normal. 
Remarks
A normal transform performs the transformation with the assumption that the w component is zero. This causes the fourth row and fourth column of the matrix to be unused. The end result is a vector that is not translated, but all other transformation properties apply. This is often preferred for normal vectors as normals purely represent direction rather than location because normal vectors should not be translated.
TransformNormal(ref Vector3, ref Matrix, out Vector3)
Performs a normal transformation using the given Matrix.
Declaration
public static void TransformNormal(ref Vector3 normal, ref Matrix transform, out Vector3 result)
Parameters
Vector3
normal
The normal vector to transform. 
Matrix
transform
The transformation Matrix. 
Vector3
result
When the method completes, contains the transformed normal. 
Remarks
A normal transform performs the transformation with the assumption that the w component is zero. This causes the fourth row and fourth column of the matrix to be unused. The end result is a vector that is not translated, but all other transformation properties apply. This is often preferred for normal vectors as normals purely represent direction rather than location because normal vectors should not be translated.
TransformNormal(Vector3[], ref Matrix, Vector3[])
Performs a normal transformation on an array of vectors using the given Matrix.
Declaration
public static void TransformNormal(Vector3[] source, ref Matrix transform, Vector3[] destination)
Parameters
Vector3[]
source
The array of normal vectors to transform. 
Matrix
transform
The transformation Matrix. 
Vector3[]
destination
The array for which the transformed vectors are stored.
This array may be the same array as 
Remarks
A normal transform performs the transformation with the assumption that the w component is zero. This causes the fourth row and fourth column of the matrix to be unused. The end result is a vector that is not translated, but all other transformation properties apply. This is often preferred for normal vectors as normals purely represent direction rather than location because normal vectors should not be translated.
Exceptions
System.ArgumentNullException
Thrown when 
System.ArgumentOutOfRangeException
Thrown when 
Unproject(Vector3, Single, Single, Single, Single, Single, Single, Matrix)
Projects a 3D vector from screen space into object space.
Declaration
public static Vector3 Unproject(Vector3 vector, float x, float y, float width, float height, float minZ, float maxZ, Matrix worldViewProjection)
Parameters
Vector3
vector
The vector to project. 
System.Single
x
The X position of the viewport. 
System.Single
y
The Y position of the viewport. 
System.Single
width
The width of the viewport. 
System.Single
height
The height of the viewport. 
System.Single
minZ
The minimum depth of the viewport. 
System.Single
maxZ
The maximum depth of the viewport. 
Matrix
worldViewProjection
The combined worldviewprojection matrix. 
Returns
Vector3
The vector in object space. 
Unproject(ref Vector3, Single, Single, Single, Single, Single, Single, ref Matrix, out Vector3)
Projects a 3D vector from screen space into object space.
Declaration
public static void Unproject(ref Vector3 vector, float x, float y, float width, float height, float minZ, float maxZ, ref Matrix worldViewProjection, out Vector3 result)
Parameters
Vector3
vector
The vector to project. 
System.Single
x
The X position of the viewport. 
System.Single
y
The Y position of the viewport. 
System.Single
width
The width of the viewport. 
System.Single
height
The height of the viewport. 
System.Single
minZ
The minimum depth of the viewport. 
System.Single
maxZ
The maximum depth of the viewport. 
Matrix
worldViewProjection
The combined worldviewprojection matrix. 
Vector3
result
When the method completes, contains the vector in object space. 
UnwindEuler()
When this vector contains Euler angles (degrees), ensure that angles are between +/180
Declaration
public void UnwindEuler()
Operators
Addition(Vector3, Vector3)
Adds two vectors.
Declaration
public static Vector3 operator +(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first vector to add. 
Vector3
right
The second vector to add. 
Returns
Vector3
The sum of the two vectors. 
Addition(Vector3, Single)
Perform a componentwise addition
Declaration
public static Vector3 operator +(Vector3 value, float scalar)
Parameters
Vector3
value
The input vector. 
System.Single
scalar
The scalar value to be added on elements 
Returns
Vector3
The vector with added scalar for each element. 
Addition(Single, Vector3)
Perform a componentwise addition
Declaration
public static Vector3 operator +(float scalar, Vector3 value)
Parameters
System.Single
scalar
The scalar value to be added on elements 
Vector3
value
The input vector. 
Returns
Vector3
The vector with added scalar for each element. 
Division(Vector3, Vector3)
Scales a vector by the given value.
Declaration
public static Vector3 operator /(Vector3 value, Vector3 scale)
Parameters
Vector3
value
The vector to scale. 
Vector3
scale
The amount by which to scale the vector. 
Returns
Vector3
The scaled vector. 
Division(Vector3, Single)
Scales a vector by the given value.
Declaration
public static Vector3 operator /(Vector3 value, float scale)
Parameters
Vector3
value
The vector to scale. 
System.Single
scale
The amount by which to scale the vector. 
Returns
Vector3
The scaled vector. 
Division(Single, Vector3)
Scales a vector by the given value.
Declaration
public static Vector3 operator /(float scale, Vector3 value)
Parameters
System.Single
scale
The amount by which to scale the vector. 
Vector3
value
The vector to scale. 
Returns
Vector3
The scaled vector. 
Equality(Vector3, Vector3)
Tests for equality between two objects.
Declaration
public static bool operator ==(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first value to compare. 
Vector3
right
The second value to compare. 
Returns
System.Boolean

Explicit(Vector3 to Vector2)
Declaration
public static explicit operator Vector2(Vector3 value)
Parameters
Vector3
value
The value. 
Returns
Vector2
The result of the conversion. 
Explicit(Vector3 to Vector4)
Declaration
public static explicit operator Vector4(Vector3 value)
Parameters
Vector3
value
The value. 
Returns
Vector4
The result of the conversion. 
Inequality(Vector3, Vector3)
Tests for inequality between two objects.
Declaration
public static bool operator !=(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first value to compare. 
Vector3
right
The second value to compare. 
Returns
System.Boolean

Modulus(Vector3, Vector3)
Remainder of value divided by scale.
Declaration
public static Vector3 operator %(Vector3 value, Vector3 scale)
Parameters
Vector3
value
The vector to scale. 
Vector3
scale
The amount by which to scale the vector. 
Returns
Vector3
The remained vector. 
Modulus(Vector3, Single)
Remainder of value divided by scale.
Declaration
public static Vector3 operator %(Vector3 value, float scale)
Parameters
Vector3
value
The vector to scale. 
System.Single
scale
The amount by which to scale the vector. 
Returns
Vector3
The remained vector. 
Modulus(Single, Vector3)
Remainder of value divided by scale.
Declaration
public static Vector3 operator %(float value, Vector3 scale)
Parameters
System.Single
value
The amount by which to scale the vector. 
Vector3
scale
The vector to scale. 
Returns
Vector3
The remained vector. 
Multiply(Vector3, Quaternion)
Transforms a vector by the given rotation.
Declaration
public static Vector3 operator *(Vector3 vector, Quaternion rotation)
Parameters
Vector3
vector
The vector to transform. 
Quaternion
rotation
The quaternion. 
Returns
Vector3
The scaled vector. 
Multiply(Vector3, Vector3)
Multiplies a vector with another by performing componentwise multiplication equivalent to Multiply(ref Vector3, ref Vector3, out Vector3).
Declaration
public static Vector3 operator *(Vector3 left, Vector3 right)
Parameters
Vector3
left
The first vector to multiply. 
Vector3
right
The second vector to multiply. 
Returns
Vector3
The multiplication of the two vectors. 
Multiply(Vector3, Single)
Scales a vector by the given value.
Declaration
public static Vector3 operator *(Vector3 value, float scale)
Parameters
Vector3
value
The vector to scale. 
System.Single
scale
The amount by which to scale the vector. 
Returns
Vector3
The scaled vector. 
Multiply(Single, Vector3)
Scales a vector by the given value.
Declaration
public static Vector3 operator *(float scale, Vector3 value)
Parameters
System.Single
scale
The amount by which to scale the vector. 
Vector3
value
The vector to scale. 
Returns
Vector3
The scaled vector. 
Subtraction(Vector3, Vector3)
Subtracts two vectors.
Declaration
public static Vector3 operator (Vector3 left, Vector3 right)
Parameters
Vector3
left
The first vector to subtract. 
Vector3
right
The second vector to subtract. 
Returns
Vector3
The difference of the two vectors. 
Subtraction(Vector3, Single)
Perform a componentwise subtraction
Declaration
public static Vector3 operator (Vector3 value, float scalar)
Parameters
Vector3
value
The input vector. 
System.Single
scalar
The scalar value to be subtracted from elements 
Returns
Vector3
The vector with added scalar from each element. 
Subtraction(Single, Vector3)
Perform a componentwise subtraction
Declaration
public static Vector3 operator (float scalar, Vector3 value)
Parameters
System.Single
scalar
The scalar value to be subtracted from elements 
Vector3
value
The input vector. 
Returns
Vector3
The vector with subtracted scalar from each element. 
UnaryNegation(Vector3)
Reverses the direction of a given vector.
Declaration
public static Vector3 operator (Vector3 value)
Parameters
Vector3
value
The vector to negate. 
Returns
Vector3
A vector facing in the opposite direction. 
UnaryPlus(Vector3)
Assert a vector (return it unchanged).
Declaration
public static Vector3 operator +(Vector3 value)
Parameters
Vector3
value
The vector to assert (unchanged). 
Returns
Vector3
The asserted (unchanged) vector. 