Class Vector3
- Namespace
- NominalSystems.Maths
- Assembly
- NominalSystems.Maths.dll
[NominalSystems] A semi-major vector 3
public sealed class Vector3
- Inheritance
-
Vector3
Constructors
Vector3()
Default constructor
public Vector3()
Vector3(Vector2, double)
Default constructor
public Vector3(Vector2 xy, double z)
Parameters
Vector3(Vector3)
Default constructor
public Vector3(Vector3 xyz)
Parameters
xyz
Vector3x,y,z value
Vector3(double)
Default constructor
public Vector3(double xyz)
Parameters
xyz
doublex,y,z value
Vector3(double, Vector2)
Default constructor
public Vector3(double x, Vector2 yz)
Parameters
Vector3(double, double, double)
Default constructor
public Vector3(double x, double y, double z)
Parameters
Vector3(double[])
Default constructor
public Vector3(double[] array)
Parameters
array
double[]Array value of xyz
Properties
Forward
[Static] The Forward unit 'Vector3'
public static Vector3 Forward { get; }
Property Value
this[int]
Get/Set 'Matrix3' data
public double this[int i] { get; set; }
Parameters
i
intindex
Property Value
this[uint]
Get/Set 'Matrix3' data
public double this[uint i] { get; set; }
Parameters
i
uintindex
Property Value
Right
[Static] The Right unit 'Vector3'
public static Vector3 Right { get; }
Property Value
Size
The total size
public uint Size { get; }
Property Value
Up
[Static] The Up unit 'Vector3'
public static Vector3 Up { get; }
Property Value
X
1st value in vector
public double X { get; set; }
Property Value
Y
2nd value in vector
public double Y { get; set; }
Property Value
Z
3rd value in vector
public double Z { get; set; }
Property Value
Methods
AngleDegrees(Vector3, Vector3)
Calculate angle between 2 'Vector3' (degrees)
public static double AngleDegrees(Vector3 a, Vector3 b)
Parameters
Returns
AngleRadians(Vector3, Vector3)
Calculate angle between 2 'Vector3' (radians)
public static double AngleRadians(Vector3 a, Vector3 b)
Parameters
Returns
Clear()
Clears all values from the data and sets the values to 0.0.
public void Clear()
Cross(Vector3, Vector3)
Calculate cross product of 'Vector3'
public static Vector3 Cross(Vector3 a, Vector3 b)
Parameters
Returns
Direction(Vector3, Vector3)
Calculate the unit vector pointing from a to b
public static Vector3 Direction(Vector3 a, Vector3 b)
Parameters
Returns
Distance(Vector3, Vector3)
Calculate distance between 2 'Vector3'
public static double Distance(Vector3 a, Vector3 b)
Parameters
Returns
Dot(Vector3, Vector3)
Calculate dot product of 'Vector3'
public static double Dot(Vector3 a, Vector3 b)
Parameters
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
Equals(object, double)
Determine whether the specified object is equal to the current matrix, with some specified precision
public bool Equals(object obj, double precision)
Parameters
obj
objectThe object to compare with the current object
precision
doubleThe precision within which values are considered equal
Returns
- bool
true if the specified object is equal to the current object; otherwise, false
GetHashCode()
public override int GetHashCode()
Returns
IsNaN(Vector3)
Is 'Vector3' not a number
public static bool IsNaN(Vector3 a)
Parameters
a
Vector3
Returns
IsZero(Vector3)
Is 'Vector3' zero
public static bool IsZero(Vector3 a)
Parameters
a
Vector3
Returns
Lerp(Vector3, Vector3, double)
Linear Interpolates between two vectors based on an alpha between 0 and 1.
public static Vector3 Lerp(Vector3 a, Vector3 b, double alpha)
Parameters
a
Vector3The first vector
b
Vector3The second vector
alpha
doubleThe value between 0 and 1 to lerp between the first and second vector
Returns
- Vector3
The Interpolated Vector
Lerp(Vector3, Vector3, double, double, double)
Linear Interpolates between two vectors based on an alpha between 0 and 1.
public static Vector3 Lerp(Vector3 a, Vector3 b, double time_a, double time_b, double time_current)
Parameters
a
Vector3The first vector
b
Vector3The second vector
time_a
doubleThe time of the first vector
time_b
doubleThe time of the second vector
time_current
doubleThe current time to interpolate between
Returns
- Vector3
The Interpolated Vector
Offset(Vector3, Vector3)
Calculate the vector from a to b
public static Vector3 Offset(Vector3 a, Vector3 b)
Parameters
Returns
OuterProduct(Vector3, Vector3)
Calculate outer product of 2 'Vector3'
public static Matrix3 OuterProduct(Vector3 a, Vector3 b)
Parameters
Returns
ToString()
public override string ToString()
Returns
ToString(string)
Prints the Vector to a string with some default formatting
public string ToString(string format = "0.0000")
Parameters
format
stringThe formatting of the string
Returns
- string
The string from the vector
Operators
operator +(Vector3, Vector3)
Returns the addition of a 'Vector' with a 'Vector'
public static Vector3 operator +(Vector3 a, Vector3 b)
Parameters
Returns
operator +(Vector3, double)
Returns the addition of a 'Vector' with a 'double'
public static Vector3 operator +(Vector3 a, double b)
Parameters
Returns
operator +(double, Vector3)
Returns the addition of a 'double' with a 'Vector'
public static Vector3 operator +(double a, Vector3 b)
Parameters
Returns
operator /(Vector3, Vector3)
Returns the division of a 'Vector' with a 'Vector'
public static Vector3 operator /(Vector3 a, Vector3 b)
Parameters
Returns
operator /(Vector3, double)
Returns the division of a 'Vector' with a 'double'
public static Vector3 operator /(Vector3 a, double b)
Parameters
Returns
operator /(double, Vector3)
Returns the division of a 'double' with a 'Vector'
public static Vector3 operator /(double a, Vector3 b)
Parameters
Returns
operator ==(Vector3, Vector3)
'Vector3' == 'Vector3' = 'bool'
public static bool operator ==(Vector3 a, Vector3 b)
Parameters
Returns
operator >(Vector3, Vector3)
'Vector3' > 'Vector3' = 'bool'
public static bool operator >(Vector3 a, Vector3 b)
Parameters
Returns
operator >(Vector3, double)
'Vector3' > 'Vector3' = 'bool'
public static bool operator >(Vector3 a, double b)
Parameters
Returns
operator >(double, Vector3)
'Vector3' > 'Vector3' = 'bool'
public static bool operator >(double a, Vector3 b)
Parameters
Returns
implicit operator Vector3(Vector)
Implicit cast 'Vector' to 'Vector3'
public static implicit operator Vector3(Vector a)
Parameters
a
Vector
Returns
implicit operator Vector(Vector3)
Implicit cast 'Vector3' to 'Vector'
public static implicit operator Vector(Vector3 a)
Parameters
a
Vector3
Returns
implicit operator Vector3(double[])
Implicit cast 'Vector3' to 'Vector'
public static implicit operator Vector3(double[] a)
Parameters
a
double[]
Returns
operator !=(Vector3, Vector3)
'Vector3' != 'Vector3' = 'bool'
public static bool operator !=(Vector3 a, Vector3 b)
Parameters
Returns
operator <(Vector3, Vector3)
'Vector3' < 'Vector3' = 'bool'
public static bool operator <(Vector3 a, Vector3 b)
Parameters
Returns
operator <(Vector3, double)
'double' < 'Vector3' = 'bool'
public static bool operator <(Vector3 a, double b)
Parameters
Returns
operator <(double, Vector3)
'double' < 'Vector3' = 'bool'
public static bool operator <(double a, Vector3 b)
Parameters
Returns
operator *(Vector3, Vector3)
Returns the multiplication of a 'Vector' with a 'Vector'
public static Vector3 operator *(Vector3 a, Vector3 b)
Parameters
Returns
operator *(Vector3, double)
Returns the multiplication of a 'Vector' with a 'double'
public static Vector3 operator *(Vector3 a, double b)
Parameters
Returns
operator *(double, Vector3)
Returns the multiplication of a 'double' with a 'Vector'
public static Vector3 operator *(double a, Vector3 b)
Parameters
Returns
operator -(Vector3, Vector3)
Returns the subtraction of a 'Vector' with a 'Vector'
public static Vector3 operator -(Vector3 a, Vector3 b)
Parameters
Returns
operator -(Vector3, double)
Returns the subtraction of a 'Vector' with a 'double'
public static Vector3 operator -(Vector3 a, double b)
Parameters
Returns
operator -(double, Vector3)
Returns the subtraction of a 'double' with a 'Vector'
public static Vector3 operator -(double a, Vector3 b)
Parameters
Returns
operator -(Vector3)
Returns the negation of a 'Vector'
public static Vector3 operator -(Vector3 a)
Parameters
a
Vector3