XyzTupleExtentions Class
Provides extension methods of the (float X, float Y, float Z)
tuple representing a vector in three-dimensional Euclidean space.
public static class XyzTupleExtentions
- Inheritance
-
Xyz
Tuple Extentions
Methods
Methods Detail
Opposite((float X, float Y, float Z))
Gets the opposite vector.
public static (float X, float Y, float Z) Opposite(this in (float X, float Y, float Z) p)
Parameters
A vector.
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.
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
A vector.
Another vector.
Returns
The sum of p
and q
.
Add((float X, float Y, float Z), Position)
Gets the sum of two vectors.
public static (float X, float Y, float Z) Add(this in (float X, float Y, float Z) p, Position q)
Parameters
A vector.
- 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.
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
A vector.
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.
public static (float X, float Y, float Z) Sub(this in (float X, float Y, float Z) p, Position q)
Parameters
A vector.
- 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.
public static (float X, float Y, float Z) Mul(this in (float X, float Y, float Z) p, float m)
Parameters
A vector.
- m
- float
A scalar.
Returns
A vector multiplied by m
.
Div((float X, float Y, float Z), float)
Gets the scalar division.
public static (float X, float Y, float Z) Div(this in (float X, float Y, float Z) p, float m)
Parameters
A vector.
- m
- float
A scalar.
Returns
A vector divided by m
.
SquareLength((float X, float Y, float Z))
Gets the squared length.
public static float SquareLength(this in (float X, float Y, float Z) p)
Parameters
A vector.
Returns
The squared length.
Length((float X, float Y, float Z))
Gets the length.
public static float Length(this in (float X, float Y, float Z) p)
Parameters
A vector.
Returns
The length.
CrossProduct((float X, float Y, float Z), (float X, float Y, float Z))
Gets the cross product of two vectors.
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
A vector.
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.
public static (float X, float Y, float Z) CrossProduct(this in (float X, float Y, float Z) p, Position q)
Parameters
A vector.
- 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.
public static (float X, float Y, float Z) Normalize(this in (float X, float Y, float Z) p)
Parameters
A vector.
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.
public static float DotProduct(this in (float X, float Y, float Z) p, in (float X, float Y, float Z) q)
Parameters
A vector.
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.
public static float DotProduct(this in (float X, float Y, float Z) p, Position q)
Parameters
A vector.
- 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.
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
A vector.
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.
public static (float X, float Y, float Z) GetLerp(this in (float X, float Y, float Z) p, Position q, float t)
Parameters
A vector.
- 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.
public static (float X, float Y, float Z) InverseX(this in (float X, float Y, float Z) p)
Parameters
A vector.
Returns
The vector with the X component inversed.
InverseY((float X, float Y, float Z))
Gets the vector with the Y component inversed.
public static (float X, float Y, float Z) InverseY(this in (float X, float Y, float Z) p)
Parameters
A vector.
Returns
The vector with the Y component inversed.
InverseZ((float X, float Y, float Z))
Gets the vector with the Z component inversed.
public static (float X, float Y, float Z) InverseZ(this in (float X, float Y, float Z) p)
Parameters
A vector.
Returns
The vector with the Z component inversed.
ToPosition((float X, float Y, float Z))
Gets the new Position object representing this.
public static Position ToPosition(this in (float X, float Y, float Z) p)
Parameters
A vector.