Table of Contents

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

x double
y double
z double

Fields

X

The vector's 1st value.

public double X

Field Value

double

Y

The vector's 2nd value.

public double Y

Field Value

double

Z

The vector's 3rd value.

public double Z

Field Value

double

Properties

Forward

A cartesion representation of the 3D forward direction.

public static Vector3 Forward { get; }

Property Value

Vector3

Length

A number representing the length/magnitude of the vector.

public readonly double Length { get; }

Property Value

double

Length2

A number representing the squared length/magnitude of the vector.

public readonly double Length2 { get; }

Property Value

double

Normalized

A vector representing the same vector with a length/magnitude of 1.

public readonly Vector3 Normalized { get; }

Property Value

Vector3

One

A vector with all values initialized with 1's.

public static Vector3 One { get; }

Property Value

Vector3

Right

A cartesion representation of the 3D right direction.

public static Vector3 Right { get; }

Property Value

Vector3

Up

A cartesion representation of the 3D up direction.

public static Vector3 Up { get; }

Property Value

Vector3

Zero

A vector with all values initialized with 0's.

public static Vector3 Zero { get; }

Property Value

Vector3

Methods

Cross(in Vector3, in Vector3)

Returns the cross product of 2 vectors.

public static Vector3 Cross(in Vector3 a, in Vector3 b)

Parameters

a Vector3
b Vector3

Returns

Vector3

Dot(in Vector3, in Vector3)

Returns the dot product of 2 vectors.

public static double Dot(in Vector3 a, in Vector3 b)

Parameters

a Vector3
b Vector3

Returns

double

Equals(object)

public override readonly bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(object, in double)

public readonly bool Equals(object obj, in double precision)

Parameters

obj object

The object to compare.

precision double

The precision error.

Returns

bool

GetEnumerator()

public readonly IEnumerator<double> GetEnumerator()

Returns

IEnumerator<double>

GetHashCode()

public override readonly int GetHashCode()

Returns

int

ToString()

public override readonly string ToString()

Returns

string

ToString(string)

public readonly string ToString(string fmt)

Parameters

fmt string

A numeric format string.

Returns

string

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

a Vector3
b Vector3

Returns

Vector3

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

a Vector3
b double

Returns

Vector3

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

a double
b Vector3

Returns

Vector3

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

a Vector3
b Vector3

Returns

Vector3

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

a Vector3
b double

Returns

Vector3

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

a double
b Vector3

Returns

Vector3

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

a Vector3
b Vector3

Returns

bool

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

a Vector3
b double

Returns

bool

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

a double
b Vector3

Returns

bool

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

a Vector3
b double

Returns

bool

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

a double
b Vector3

Returns

bool

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

a Vector3
b double

Returns

bool

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

a double
b Vector3

Returns

bool

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

a Vector3
b Vector3

Returns

bool

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

a Vector3
b double

Returns

bool

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

a double
b Vector3

Returns

bool

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

a Vector3
b double

Returns

bool

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

a double
b Vector3

Returns

bool

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

a Vector3
b double

Returns

bool

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

a double
b Vector3

Returns

bool

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

a Vector3
b Vector3

Returns

Vector3

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

a Vector3
b double

Returns

Vector3

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

a double
b Vector3

Returns

Vector3

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

a Vector3
b Vector3

Returns

Vector3

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

a Vector3
b double

Returns

Vector3

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

a double
b Vector3

Returns

Vector3

operator -(in Vector3)

Returns the negation of all values in a vector.

public static Vector3 operator -(in Vector3 a)

Parameters

a Vector3

Returns

Vector3