Struct Vector3
- Namespace
- NominalSystems
- Assembly
- NominalSystems.Core.dll
Represents a vector or array of 3 numbers (or a matrix with 1 row or 1 column).
public struct Vector3 : IEnumerable<double>, IEnumerable
- Implements
Constructors
Vector3()
Creates a zero-initialized vector.
public Vector3()
Vector3(in Vector3)
Creates a deep-copy from another vector.
public Vector3(in Vector3 a)
Parameters
a
Vector3
Vector3(in double)
Creates a value-initialized vector.
public Vector3(in double a)
Parameters
a
double
Vector3(in double, in double, in double)
Creates and initializes all vector values.
public Vector3(in double x, in double y, in double z)
Parameters
Fields
X
The vector's 1st value.
public double X
Field Value
Y
The vector's 2nd value.
public double Y
Field Value
Z
The vector's 3rd value.
public double Z
Field Value
Properties
Forward
A cartesion representation of the 3D forward direction.
public static Vector3 Forward { get; }
Property Value
Length
A number representing the length/magnitude of the vector.
public readonly double Length { get; }
Property Value
Length2
A number representing the squared length/magnitude of the vector.
public readonly double Length2 { get; }
Property Value
Normalized
A vector representing the same vector with a length/magnitude of 1.
public readonly Vector3 Normalized { get; }
Property Value
One
A vector with all values initialized with 1's.
public static Vector3 One { get; }
Property Value
Right
A cartesion representation of the 3D right direction.
public static Vector3 Right { get; }
Property Value
Up
A cartesion representation of the 3D up direction.
public static Vector3 Up { get; }
Property Value
Zero
A vector with all values initialized with 0's.
public static Vector3 Zero { get; }
Property Value
Methods
Cross(in Vector3, in Vector3)
Returns the cross product of 2 vectors.
public static Vector3 Cross(in Vector3 a, in Vector3 b)
Parameters
Returns
Dot(in Vector3, in Vector3)
Returns the dot product of 2 vectors.
public static double Dot(in Vector3 a, in Vector3 b)
Parameters
Returns
Equals(object)
public override readonly bool Equals(object obj)
Parameters
obj
object
Returns
Equals(object, in double)
public readonly bool Equals(object obj, in double precision)
Parameters
Returns
GetEnumerator()
public readonly IEnumerator<double> GetEnumerator()
Returns
GetHashCode()
public override readonly int GetHashCode()
Returns
ToString()
public override readonly string ToString()
Returns
ToString(string)
public readonly string ToString(string fmt)
Parameters
fmt
stringA numeric format string.
Returns
Operators
operator +(in Vector3, in Vector3)
Returns the addition of a vector with another vector.
public static Vector3 operator +(in Vector3 a, in Vector3 b)
Parameters
Returns
operator +(in Vector3, in double)
Returns the addition of a vector with a number.
public static Vector3 operator +(in Vector3 a, in double b)
Parameters
Returns
operator +(in double, in Vector3)
Returns the addition of a number with a vector.
public static Vector3 operator +(in double a, in Vector3 b)
Parameters
Returns
operator /(in Vector3, in Vector3)
Returns the division of a vector with another vector.
public static Vector3 operator /(in Vector3 a, in Vector3 b)
Parameters
Returns
operator /(in Vector3, in double)
Returns the division of a vector with a number.
public static Vector3 operator /(in Vector3 a, in double b)
Parameters
Returns
operator /(in double, in Vector3)
Returns the division of a number with a vector.
public static Vector3 operator /(in double a, in Vector3 b)
Parameters
Returns
operator ==(in Vector3, in Vector3)
Returns true if all values in a vector are equal to another vector.
public static bool operator ==(in Vector3 a, in Vector3 b)
Parameters
Returns
operator ==(in Vector3, in double)
Returns true if all values in a vector are equal to a number.
public static bool operator ==(in Vector3 a, in double b)
Parameters
Returns
operator ==(in double, in Vector3)
Returns true if a number is equal to all values in a vector.
public static bool operator ==(in double a, in Vector3 b)
Parameters
Returns
operator >(in Vector3, in double)
Returns true if all values in a vector are greater than a number.
public static bool operator >(in Vector3 a, in double b)
Parameters
Returns
operator >(in double, in Vector3)
Returns true if a number is greater than all values in a vector.
public static bool operator >(in double a, in Vector3 b)
Parameters
Returns
operator >=(in Vector3, in double)
Returns true if all values in a vector are greater than or equal to a number.
public static bool operator >=(in Vector3 a, in double b)
Parameters
Returns
operator >=(in double, in Vector3)
Returns true if a number is greater than or equal to all values in a vector.
public static bool operator >=(in double a, in Vector3 b)
Parameters
Returns
operator !=(in Vector3, in Vector3)
Returns true if all values in a vector are not equal to another vector.
public static bool operator !=(in Vector3 a, in Vector3 b)
Parameters
Returns
operator !=(in Vector3, in double)
Returns true if all values in a vector are not equal to a number.
public static bool operator !=(in Vector3 a, in double b)
Parameters
Returns
operator !=(in double, in Vector3)
Returns true if a number is not equal to all values in a vector.
public static bool operator !=(in double a, in Vector3 b)
Parameters
Returns
operator <(in Vector3, in double)
Returns true if all values in a vector are less than a number.
public static bool operator <(in Vector3 a, in double b)
Parameters
Returns
operator <(in double, in Vector3)
Returns true if a number is less than all values in a vector.
public static bool operator <(in double a, in Vector3 b)
Parameters
Returns
operator <=(in Vector3, in double)
Returns true if all values in a vector are less than or equal to a number.
public static bool operator <=(in Vector3 a, in double b)
Parameters
Returns
operator <=(in double, in Vector3)
Returns true if a number is less than or equal to all values in a vector.
public static bool operator <=(in double a, in Vector3 b)
Parameters
Returns
operator *(in Vector3, in Vector3)
Returns the multiplication of a vector with another vector.
public static Vector3 operator *(in Vector3 a, in Vector3 b)
Parameters
Returns
operator *(in Vector3, in double)
Returns the multiplication of a vector with a number.
public static Vector3 operator *(in Vector3 a, in double b)
Parameters
Returns
operator *(in double, in Vector3)
Returns the multiplication of a number with a vector.
public static Vector3 operator *(in double a, in Vector3 b)
Parameters
Returns
operator -(in Vector3, in Vector3)
Returns the subtraction of a vector with another vector.
public static Vector3 operator -(in Vector3 a, in Vector3 b)
Parameters
Returns
operator -(in Vector3, in double)
Returns the subtraction of a vector with a number.
public static Vector3 operator -(in Vector3 a, in double b)
Parameters
Returns
operator -(in double, in Vector3)
Returns the subtraction of a number with a vector.
public static Vector3 operator -(in double a, in Vector3 b)
Parameters
Returns
operator -(in Vector3)
Returns the negation of all values in a vector.
public static Vector3 operator -(in Vector3 a)
Parameters
a
Vector3