Table of Contents

Struct Vector4

Namespace
NominalSystems
Assembly
NominalSystems.Core.dll

Represents a vector or array of 4 numbers (or a matrix with 1 row or 1 column).


public struct Vector4 : IEnumerable<double>, IEnumerable
Implements

Constructors

Vector4()

Creates a zero-initialized vector.

public Vector4()

Vector4(in Vector4)

Creates a deep-copy from another vector.

public Vector4(in Vector4 a)

Parameters

a Vector4

Vector4(in double)

Creates a value-initialized vector.

public Vector4(in double a)

Parameters

a double

Vector4(in double, in double, in double, in double)

Creates and initializes all vector values.

public Vector4(in double x, in double y, in double z, in double w)

Parameters

x double
y double
z double
w double

Fields

W

The vector's 4th value.

public double W

Field Value

double

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

One

A vector with all values initialized with 1's.

public static Vector4 One { get; }

Property Value

Vector4

Zero

A vector with all values initialized with 0's.

public static Vector4 Zero { get; }

Property Value

Vector4

Methods

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 Vector4, in Vector4)

Returns the addition of a vector with another vector.

public static Vector4 operator +(in Vector4 a, in Vector4 b)

Parameters

a Vector4
b Vector4

Returns

Vector4

operator +(in Vector4, in double)

Returns the addition of a vector with a number.

public static Vector4 operator +(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

Vector4

operator +(in double, in Vector4)

Returns the addition of a number with a vector.

public static Vector4 operator +(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

Vector4

operator /(in Vector4, in Vector4)

Returns the division of a vector with another vector.

public static Vector4 operator /(in Vector4 a, in Vector4 b)

Parameters

a Vector4
b Vector4

Returns

Vector4

operator /(in Vector4, in double)

Returns the division of a vector with a number.

public static Vector4 operator /(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

Vector4

operator /(in double, in Vector4)

Returns the division of a number with a vector.

public static Vector4 operator /(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

Vector4

operator ==(in Vector4, in Vector4)

Returns true if all values in a vector are equal to another vector.

public static bool operator ==(in Vector4 a, in Vector4 b)

Parameters

a Vector4
b Vector4

Returns

bool

operator ==(in Vector4, in double)

Returns true if all values in a vector are equal to a number.

public static bool operator ==(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

bool

operator ==(in double, in Vector4)

Returns true if a number is equal to all values in a vector.

public static bool operator ==(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

bool

operator >(in Vector4, in double)

Returns true if all values in a vector are greater than a number.

public static bool operator >(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

bool

operator >(in double, in Vector4)

Returns true if a number is greater than all values in a vector.

public static bool operator >(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

bool

operator >=(in Vector4, in double)

Returns true if all values in a vector are greater than or equal to a number.

public static bool operator >=(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

bool

operator >=(in double, in Vector4)

Returns true if a number is greater than or equal to all values in a vector.

public static bool operator >=(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

bool

operator !=(in Vector4, in Vector4)

Returns true if all values in a vector are not equal to another vector.

public static bool operator !=(in Vector4 a, in Vector4 b)

Parameters

a Vector4
b Vector4

Returns

bool

operator !=(in Vector4, in double)

Returns true if all values in a vector are not equal to a number.

public static bool operator !=(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

bool

operator !=(in double, in Vector4)

Returns true if a number is not equal to all values in a vector.

public static bool operator !=(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

bool

operator <(in Vector4, in double)

Returns true if all values in a vector are less than a number.

public static bool operator <(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

bool

operator <(in double, in Vector4)

Returns true if a number is less than all values in a vector.

public static bool operator <(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

bool

operator <=(in Vector4, in double)

Returns true if all values in a vector are less than or equal to a number.

public static bool operator <=(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

bool

operator <=(in double, in Vector4)

Returns true if a number is less than or equal to all values in a vector.

public static bool operator <=(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

bool

operator *(in Vector4, in Vector4)

Returns the multiplication of a vector with another vector.

public static Vector4 operator *(in Vector4 a, in Vector4 b)

Parameters

a Vector4
b Vector4

Returns

Vector4

operator *(in Vector4, in double)

Returns the multiplication of a vector with a number.

public static Vector4 operator *(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

Vector4

operator *(in double, in Vector4)

Returns the multiplication of a number with a vector.

public static Vector4 operator *(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

Vector4

operator -(in Vector4, in Vector4)

Returns the subtraction of a vector with another vector.

public static Vector4 operator -(in Vector4 a, in Vector4 b)

Parameters

a Vector4
b Vector4

Returns

Vector4

operator -(in Vector4, in double)

Returns the subtraction of a vector with a number.

public static Vector4 operator -(in Vector4 a, in double b)

Parameters

a Vector4
b double

Returns

Vector4

operator -(in double, in Vector4)

Returns the subtraction of a number with a vector.

public static Vector4 operator -(in double a, in Vector4 b)

Parameters

a double
b Vector4

Returns

Vector4

operator -(in Vector4)

Returns the negation of all values in a vector.

public static Vector4 operator -(in Vector4 a)

Parameters

a Vector4

Returns

Vector4