XyzTupleExtentions Class

Provides extension methods of the (float X, float Y, float Z) tuple representing a vector in three-dimensional Euclidean space.

C#
public static class XyzTupleExtentions
Inheritance
XyzTupleExtentions

Methods

Opposite((float X, float Y, float Z))

Gets the opposite vector.

Add((float X, float Y, float Z), (float X, float Y, float Z))

Gets the sum of two vectors.

Add((float X, float Y, float Z), Position)

Gets the sum of two vectors.

Sub((float X, float Y, float Z), (float X, float Y, float Z))

Gets the difference between two vectors.

Sub((float X, float Y, float Z), Position)

Gets the difference between two vectors.

Mul((float X, float Y, float Z), float)

Gets the scalar multiplication.

Div((float X, float Y, float Z), float)

Gets the scalar division.

SquareLength((float X, float Y, float Z))

Gets the squared length.

Length((float X, float Y, float Z))

Gets the length.

CrossProduct((float X, float Y, float Z), (float X, float Y, float Z))

Gets the cross product of two vectors.

CrossProduct((float X, float Y, float Z), Position)

Gets the cross product of two vectors.

Normalize((float X, float Y, float Z))

Gets the normalized vector.

DotProduct((float X, float Y, float Z), (float X, float Y, float Z))

Gets the dot product of two vectors.

DotProduct((float X, float Y, float Z), Position)

Gets the dot product of two vectors.

GetLerp((float X, float Y, float Z), (float X, float Y, float Z), float)

Gets the linear interpolation (Lerp) of two vectors.

GetLerp((float X, float Y, float Z), Position, float)

Gets the linear interpolation (Lerp) of two vectors.

InverseX((float X, float Y, float Z))

Gets the vector with the X component inversed.

InverseY((float X, float Y, float Z))

Gets the vector with the Y component inversed.

InverseZ((float X, float Y, float Z))

Gets the vector with the Z component inversed.

ToPosition((float X, float Y, float Z))

Gets the new Position object representing this.

Methods Detail

Opposite((float X, float Y, float Z))

Gets the opposite vector.

C#
public static (float X, float Y, float Z) Opposite(this in (float X, float Y, float Z) p)

Parameters

Returns

The opposite vector of p.

Add((float X, float Y, float Z), (float X, float Y, float Z))

Gets the sum of two vectors.

C#
public static (float X, float Y, float Z) Add(this in (float X, float Y, float Z) p, in (float X, float Y, float Z) q)

Parameters

q
(float X, float Y, float Z)

Another vector.

Returns

The sum of p and q.

Add((float X, float Y, float Z), Position)

Gets the sum of two vectors.

C#
public static (float X, float Y, float Z) Add(this in (float X, float Y, float Z) p, Position q)

Parameters

q
Position

Another vector.

Returns

The sum of p and q.

Sub((float X, float Y, float Z), (float X, float Y, float Z))

Gets the difference between two vectors.

C#
public static (float X, float Y, float Z) Sub(this in (float X, float Y, float Z) p, in (float X, float Y, float Z) q)

Parameters

q
(float X, float Y, float Z)

Another vector.

Returns

The difference between the two vectors, which represents subtracting q from p.

Sub((float X, float Y, float Z), Position)

Gets the difference between two vectors.

C#
public static (float X, float Y, float Z) Sub(this in (float X, float Y, float Z) p, Position q)

Parameters

q
Position

Another vector.

Returns

The difference between the two vectors, which represents subtracting q from p.

Mul((float X, float Y, float Z), float)

Gets the scalar multiplication.

C#
public static (float X, float Y, float Z) Mul(this in (float X, float Y, float Z) p, float m)

Parameters

m
float

A scalar.

Returns

A vector multiplied by m.

Div((float X, float Y, float Z), float)

Gets the scalar division.

C#
public static (float X, float Y, float Z) Div(this in (float X, float Y, float Z) p, float m)

Parameters

m
float

A scalar.

Returns

A vector divided by m.

SquareLength((float X, float Y, float Z))

Gets the squared length.

C#
public static float SquareLength(this in (float X, float Y, float Z) p)

Parameters

Returns

The squared length.

Length((float X, float Y, float Z))

Gets the length.

C#
public static float Length(this in (float X, float Y, float Z) p)

Parameters

Returns

The length.

CrossProduct((float X, float Y, float Z), (float X, float Y, float Z))

Gets the cross product of two vectors.

C#
public static (float X, float Y, float Z) CrossProduct(this in (float X, float Y, float Z) p, in (float X, float Y, float Z) q)

Parameters

q
(float X, float Y, float Z)

Another vector.

Returns

The cross product of two vectors, which represents p × q.

CrossProduct((float X, float Y, float Z), Position)

Gets the cross product of two vectors.

C#
public static (float X, float Y, float Z) CrossProduct(this in (float X, float Y, float Z) p, Position q)

Parameters

q
Position

Another vector.

Returns

The cross product of two vectors, which represents p × q.

Normalize((float X, float Y, float Z))

Gets the normalized vector.

C#
public static (float X, float Y, float Z) Normalize(this in (float X, float Y, float Z) p)

Parameters

Returns

A unit vector, which is the specified vector with a length of one.

DotProduct((float X, float Y, float Z), (float X, float Y, float Z))

Gets the dot product of two vectors.

C#
public static float DotProduct(this in (float X, float Y, float Z) p, in (float X, float Y, float Z) q)

Parameters

q
(float X, float Y, float Z)

Another vector.

Returns

The dot product of p and q.

DotProduct((float X, float Y, float Z), Position)

Gets the dot product of two vectors.

C#
public static float DotProduct(this in (float X, float Y, float Z) p, Position q)

Parameters

q
Position

Another vector.

Returns

The dot product of p and q.

GetLerp((float X, float Y, float Z), (float X, float Y, float Z), float)

Gets the linear interpolation (Lerp) of two vectors.

C#
public static (float X, float Y, float Z) GetLerp(this in (float X, float Y, float Z) p, in (float X, float Y, float Z) q, float t)

Parameters

q
(float X, float Y, float Z)

Another vector.

t
float

A parameter between zero and one, inclusively.

Returns

The linear-interpolated vector. This method guarantees that the return value equals p when t equals zero, and equals q when t equals one.

GetLerp((float X, float Y, float Z), Position, float)

Gets the linear interpolation (Lerp) of two vectors.

C#
public static (float X, float Y, float Z) GetLerp(this in (float X, float Y, float Z) p, Position q, float t)

Parameters

q
Position

Another vector.

t
float

A parameter between zero and one, inclusively.

Returns

The linear-interpolated vector. This method guarantees that the return value equals p when t equals zero, and equals q when t equals one.

InverseX((float X, float Y, float Z))

Gets the vector with the X component inversed.

C#
public static (float X, float Y, float Z) InverseX(this in (float X, float Y, float Z) p)

Parameters

Returns

The vector with the X component inversed.

InverseY((float X, float Y, float Z))

Gets the vector with the Y component inversed.

C#
public static (float X, float Y, float Z) InverseY(this in (float X, float Y, float Z) p)

Parameters

Returns

The vector with the Y component inversed.

InverseZ((float X, float Y, float Z))

Gets the vector with the Z component inversed.

C#
public static (float X, float Y, float Z) InverseZ(this in (float X, float Y, float Z) p)

Parameters

Returns

The vector with the Z component inversed.

ToPosition((float X, float Y, float Z))

Gets the new Position object representing this.

C#
public static Position ToPosition(this in (float X, float Y, float Z) p)

Parameters

Returns

The new Position object representing this tuple.