Struct Vector4d
Represents a 4D vector using four double-precision floating-point numbers.
Implements
Inherited Members
Namespace: OpenTK.Mathematics
Assembly: OpenTK.Mathematics.dll
Syntax
[Serializable]
public struct Vector4d : IEquatable<Vector4d>, IFormattable, IAdditionOperators<Vector4d, Vector4d, Vector4d>, ISubtractionOperators<Vector4d, Vector4d, Vector4d>, IUnaryNegationOperators<Vector4d, Vector4d>, IUnaryPlusOperators<Vector4d, Vector4d>, IMultiplyOperators<Vector4d, double, Vector4d>, IMultiplyOperators<Vector4d, Vector4d, Vector4d>, IMultiplyOperators<Vector4d, Matrix4x2d, Vector2d>, IMultiplyOperators<Vector4d, Matrix4x3d, Vector3d>, IMultiplyOperators<Vector4d, Matrix4d, Vector4d>, IDivisionOperators<Vector4d, double, Vector4d>, IDivisionOperators<Vector4d, Vector4d, Vector4d>, IEqualityOperators<Vector4d, Vector4d, bool>, IAdditiveIdentity<Vector4d, Vector4d>, IMultiplicativeIdentity<Vector4d, Vector4d>, IMinMaxValue<Vector4d>
Remarks
The Vector4 structure is suitable for interoperation with unmanaged code requiring four consecutive doubles.
Constructors
Vector4d(Vector2d, double, double)
Initializes a new instance of the Vector4d struct.
Declaration
public Vector4d(Vector2d xy, double z = 0, double w = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | xy | The x and y components of the Vector4d. |
double | z | The z component of the Vector4d. |
double | w | The w component of the Vector4d. |
Vector4d(Vector3d, double)
Initializes a new instance of the Vector4d struct.
Declaration
public Vector4d(Vector3d xyz, double w = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | xyz | The x, y and z components of the Vector4d. |
double | w | The w component of the Vector4d. |
Vector4d(double)
Initializes a new instance of the Vector4d struct.
Declaration
public Vector4d(double value)
Parameters
Type | Name | Description |
---|---|---|
double | value | The value that will initialize this instance. |
Vector4d(double, double, double, double)
Initializes a new instance of the Vector4d struct.
Declaration
public Vector4d(double x, double y, double z, double w)
Parameters
Type | Name | Description |
---|---|---|
double | x | The x component of the Vector4d. |
double | y | The y component of the Vector4d. |
double | z | The z component of the Vector4d. |
double | w | The w component of the Vector4d. |
Fields
NegativeInfinity
Defines an instance with all components set to negative infinity.
Declaration
public static readonly Vector4d NegativeInfinity
Field Value
Type | Description |
---|---|
Vector4d |
One
Defines an instance with all components set to 1.
Declaration
public static readonly Vector4d One
Field Value
Type | Description |
---|---|
Vector4d |
PositiveInfinity
Defines an instance with all components set to positive infinity.
Declaration
public static readonly Vector4d PositiveInfinity
Field Value
Type | Description |
---|---|
Vector4d |
SizeInBytes
Defines the size of the Vector4d struct in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
Type | Description |
---|---|
int |
UnitW
Defines a unit-length Vector4d that points towards the W-axis.
Declaration
public static readonly Vector4d UnitW
Field Value
Type | Description |
---|---|
Vector4d |
UnitX
Defines a unit-length Vector4d that points towards the X-axis.
Declaration
public static readonly Vector4d UnitX
Field Value
Type | Description |
---|---|
Vector4d |
UnitY
Defines a unit-length Vector4d that points towards the Y-axis.
Declaration
public static readonly Vector4d UnitY
Field Value
Type | Description |
---|---|
Vector4d |
UnitZ
Defines a unit-length Vector4d that points towards the Z-axis.
Declaration
public static readonly Vector4d UnitZ
Field Value
Type | Description |
---|---|
Vector4d |
W
The W component of the Vector4d.
Declaration
public double W
Field Value
Type | Description |
---|---|
double |
X
The X component of the Vector4d.
Declaration
public double X
Field Value
Type | Description |
---|---|
double |
Y
The Y component of the Vector4d.
Declaration
public double Y
Field Value
Type | Description |
---|---|
double |
Z
The Z component of the Vector4d.
Declaration
public double Z
Field Value
Type | Description |
---|---|
double |
Zero
Defines an instance with all components set to 0.
Declaration
public static readonly Vector4d Zero
Field Value
Type | Description |
---|---|
Vector4d |
Properties
AdditiveIdentity
Gets the additive identity of Vector4. Equivalent to Vector4.Zero.
Declaration
public static Vector4d AdditiveIdentity { get; }
Property Value
Type | Description |
---|---|
Vector4d |
this[int]
Gets or sets the value at the index of the Vector.
Declaration
public double this[int index] { readonly get; set; }
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the component from the Vector. |
Property Value
Type | Description |
---|---|
double |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if the index is less than 0 or greater than 3. |
Length
Gets the length (magnitude) of the vector.
Declaration
public readonly double Length { get; }
Property Value
Type | Description |
---|---|
double |
See Also
LengthFast
Gets an approximation of the vector length (magnitude).
Declaration
public readonly double LengthFast { get; }
Property Value
Type | Description |
---|---|
double |
Remarks
This property uses an approximation of the square root function to calculate vector magnitude.
See Also
LengthSquared
Gets the square of the vector length (magnitude).
Declaration
public readonly double LengthSquared { get; }
Property Value
Type | Description |
---|---|
double |
Remarks
This property avoids the costly square root operation required by the Length property. This makes it more suitable for comparisons.
MaxValue
Gets the max value for Vector4. Equivalent to Vector4.PositiveInfinity.
Declaration
public static Vector4d MaxValue { get; }
Property Value
Type | Description |
---|---|
Vector4d |
MinValue
Gets the min value for Vector4. Equivalent to Vector4.NegativeInfinity.
Declaration
public static Vector4d MinValue { get; }
Property Value
Type | Description |
---|---|
Vector4d |
MultiplicativeIdentity
Gets the multiplicative identity of Vector4. Equivalent to Vector4.One.
Declaration
public static Vector4d MultiplicativeIdentity { get; }
Property Value
Type | Description |
---|---|
Vector4d |
ReciprocalLengthFast
Gets an approximation of 1 over the length (magnitude) of the vector.
Declaration
public readonly double ReciprocalLengthFast { get; }
Property Value
Type | Description |
---|---|
double |
Wx
Gets or sets an OpenTK.Vector2d with the W and X components of this instance.
Declaration
public Vector2d Wx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Wxy
Gets or sets an OpenTK.Vector3d with the W, X, and Y components of this instance.
Declaration
public Vector3d Wxy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Wxyz
Gets or sets an OpenTK.Vector4d with the W, X, Y, and Z components of this instance.
Declaration
public Vector4d Wxyz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Wxz
Gets or sets an OpenTK.Vector3d with the W, X, and Z components of this instance.
Declaration
public Vector3d Wxz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Wxzy
Gets or sets an OpenTK.Vector4d with the W, X, Z, and Y components of this instance.
Declaration
public Vector4d Wxzy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Wy
Gets or sets an OpenTK.Vector2d with the W and Y components of this instance.
Declaration
public Vector2d Wy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Wyx
Gets or sets an OpenTK.Vector3d with the W, Y, and X components of this instance.
Declaration
public Vector3d Wyx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Wyxz
Gets or sets an OpenTK.Vector4d with the W, Y, X, and Z components of this instance.
Declaration
public Vector4d Wyxz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Wyz
Gets or sets an OpenTK.Vector3d with the W, Y, and Z components of this instance.
Declaration
public Vector3d Wyz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Wyzx
Gets or sets an OpenTK.Vector4d with the W, Y, Z, and X components of this instance.
Declaration
public Vector4d Wyzx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Wz
Gets or sets an OpenTK.Vector2d with the W and Z components of this instance.
Declaration
public Vector2d Wz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Wzx
Gets or sets an OpenTK.Vector3d with the W, Z, and X components of this instance.
Declaration
public Vector3d Wzx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Wzxy
Gets or sets an OpenTK.Vector4d with the W, Z, X, and Y components of this instance.
Declaration
public Vector4d Wzxy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Wzy
Gets or sets an OpenTK.Vector3d with the W, Z, and Y components of this instance.
Declaration
public Vector3d Wzy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Wzyw
Gets or sets an OpenTK.Vector4d with the W, Z, Y, and W components of this instance.
Declaration
public Vector4d Wzyw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Wzyx
Gets or sets an OpenTK.Vector4d with the W, Z, Y, and X components of this instance.
Declaration
public Vector4d Wzyx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Xw
Gets or sets an OpenTK.Vector2d with the X and W components of this instance.
Declaration
public Vector2d Xw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Xwy
Gets or sets an OpenTK.Vector3d with the X, W, and Y components of this instance.
Declaration
public Vector3d Xwy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Xwyz
Gets or sets an OpenTK.Vector4d with the X, W, Y, and Z components of this instance.
Declaration
public Vector4d Xwyz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Xwz
Gets or sets an OpenTK.Vector3d with the X, W, and Z components of this instance.
Declaration
public Vector3d Xwz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Xwzy
Gets or sets an OpenTK.Vector4d with the X, W, Z, and Y components of this instance.
Declaration
public Vector4d Xwzy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Xy
Gets or sets an OpenTK.Vector2d with the X and Y components of this instance.
Declaration
public Vector2d Xy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Xyw
Gets or sets an OpenTK.Vector3d with the X, Y, and Z components of this instance.
Declaration
public Vector3d Xyw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Xywz
Gets or sets an OpenTK.Vector4d with the X, Y, W, and Z components of this instance.
Declaration
public Vector4d Xywz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Xyz
Gets or sets an OpenTK.Vector3d with the X, Y, and Z components of this instance.
Declaration
public Vector3d Xyz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Xz
Gets or sets an OpenTK.Vector2d with the X and Z components of this instance.
Declaration
public Vector2d Xz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Xzw
Gets or sets an OpenTK.Vector3d with the X, Z, and W components of this instance.
Declaration
public Vector3d Xzw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Xzwy
Gets or sets an OpenTK.Vector4d with the X, Z, W, and Y components of this instance.
Declaration
public Vector4d Xzwy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Xzy
Gets or sets an OpenTK.Vector3d with the X, Z, and Y components of this instance.
Declaration
public Vector3d Xzy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Xzyw
Gets or sets an OpenTK.Vector4d with the X, Z, Y, and W components of this instance.
Declaration
public Vector4d Xzyw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Yw
Gets or sets an OpenTK.Vector2d with the Y and W components of this instance.
Declaration
public Vector2d Yw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Ywx
Gets or sets an OpenTK.Vector3d with the Y, W, and X components of this instance.
Declaration
public Vector3d Ywx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Ywxz
Gets or sets an OpenTK.Vector4d with the Y, W, X, and Z components of this instance.
Declaration
public Vector4d Ywxz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Ywz
Gets or sets an OpenTK.Vector3d with the Y, W, and Z components of this instance.
Declaration
public Vector3d Ywz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Ywzx
Gets or sets an OpenTK.Vector4d with the Y, W, Z, and X components of this instance.
Declaration
public Vector4d Ywzx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Yx
Gets or sets an OpenTK.Vector2d with the Y and X components of this instance.
Declaration
public Vector2d Yx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Yxw
Gets or sets an OpenTK.Vector3d with the Y, X, and W components of this instance.
Declaration
public Vector3d Yxw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Yxwz
Gets or sets an OpenTK.Vector4d with the Y, X, W, and Z components of this instance.
Declaration
public Vector4d Yxwz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Yxz
Gets or sets an OpenTK.Vector3d with the Y, X, and Z components of this instance.
Declaration
public Vector3d Yxz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Yxzw
Gets or sets an OpenTK.Vector4d with the Y, X, Z, and W components of this instance.
Declaration
public Vector4d Yxzw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Yywz
Gets or sets an OpenTK.Vector4d with the Y, Y, W, and Z components of this instance.
Declaration
public Vector4d Yywz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Yyzw
Gets or sets an OpenTK.Vector4d with the Y, Y, Z, and W components of this instance.
Declaration
public Vector4d Yyzw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Yz
Gets or sets an OpenTK.Vector2d with the Y and Z components of this instance.
Declaration
public Vector2d Yz { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Yzw
Gets or sets an OpenTK.Vector3d with the Y, Z, and W components of this instance.
Declaration
public Vector3d Yzw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Yzwx
Gets or sets an OpenTK.Vector4d with the Y, Z, W, and X components of this instance.
Declaration
public Vector4d Yzwx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Yzx
Gets or sets an OpenTK.Vector3d with the Y, Z, and X components of this instance.
Declaration
public Vector3d Yzx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Yzxw
Gets or sets an OpenTK.Vector4d with the Y, Z, X, and W components of this instance.
Declaration
public Vector4d Yzxw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Zw
Gets or sets an OpenTK.Vector2d with the Z and W components of this instance.
Declaration
public Vector2d Zw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Zwx
Gets or sets an OpenTK.Vector3d with the Z, W, and X components of this instance.
Declaration
public Vector3d Zwx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Zwxy
Gets or sets an OpenTK.Vector4d with the Z, W, X, and Y components of this instance.
Declaration
public Vector4d Zwxy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Zwy
Gets or sets an OpenTK.Vector3d with the Z, W, and Y components of this instance.
Declaration
public Vector3d Zwy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Zwyx
Gets or sets an OpenTK.Vector4d with the Z, W, Y, and X components of this instance.
Declaration
public Vector4d Zwyx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Zwzy
Gets or sets an OpenTK.Vector4d with the Z, W, Z, and Y components of this instance.
Declaration
public Vector4d Zwzy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Zx
Gets or sets an OpenTK.Vector2d with the Z and X components of this instance.
Declaration
public Vector2d Zx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Zxw
Gets or sets an OpenTK.Vector3d with the Z, X, and W components of this instance.
Declaration
public Vector3d Zxw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Zxwy
Gets or sets an OpenTK.Vector4d with the Z, X, W, and Y components of this instance.
Declaration
public Vector4d Zxwy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Zxy
Gets or sets an OpenTK.Vector3d with the Z, X, and Y components of this instance.
Declaration
public Vector3d Zxy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Zxyw
Gets or sets an OpenTK.Vector4d with the Z, X, Y, and Z components of this instance.
Declaration
public Vector4d Zxyw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Zy
Gets or sets an OpenTK.Vector2d with the Z and Y components of this instance.
Declaration
public Vector2d Zy { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Zyw
Gets or sets an OpenTK.Vector3d with the Z, Y, and W components of this instance.
Declaration
public Vector3d Zyw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Zywx
Gets or sets an OpenTK.Vector4d with the Z, Y, W, and X components of this instance.
Declaration
public Vector4d Zywx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Zyx
Gets or sets an OpenTK.Vector3d with the Z, Y, and X components of this instance.
Declaration
public Vector3d Zyx { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector3d |
Zyxw
Gets or sets an OpenTK.Vector4d with the Z, Y, X, and W components of this instance.
Declaration
public Vector4d Zyxw { readonly get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Methods
Abs()
Returns a new vector that is the component-wise absolute value of the vector.
Declaration
public readonly Vector4d Abs()
Returns
Type | Description |
---|---|
Vector4d | The component-wise absolute value vector. |
Abs(Vector4d)
Take the component-wise absolute value of a vector.
Declaration
public static Vector4d Abs(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to apply component-wise absolute value to. |
Returns
Type | Description |
---|---|
Vector4d | The component-wise absolute value vector. |
Abs(in Vector4d, out Vector4d)
Take the component-wise absolute value of a vector.
Declaration
public static void Abs(in Vector4d vec, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to apply component-wise absolute value to. |
Vector4d | result | The component-wise absolute value vector. |
Add(Vector4d, Vector4d)
Adds two vectors.
Declaration
[Pure]
public static Vector4d Add(Vector4d a, Vector4d b)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | Left operand. |
Vector4d | b | Right operand. |
Returns
Type | Description |
---|---|
Vector4d | Result of operation. |
Add(in Vector4d, in Vector4d, out Vector4d)
Adds two vectors.
Declaration
public static void Add(in Vector4d a, in Vector4d b, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | Left operand. |
Vector4d | b | Right operand. |
Vector4d | result | Result of operation. |
BaryCentric(Vector4d, Vector4d, Vector4d, double, double)
Interpolate 3 Vectors using Barycentric coordinates.
Declaration
[Pure]
public static Vector4d BaryCentric(Vector4d a, Vector4d b, Vector4d c, double u, double v)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First input Vector. |
Vector4d | b | Second input Vector. |
Vector4d | c | Third input Vector. |
double | u | First Barycentric Coordinate. |
double | v | Second Barycentric Coordinate. |
Returns
Type | Description |
---|---|
Vector4d | a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise. |
BaryCentric(in Vector4d, in Vector4d, in Vector4d, double, double, out Vector4d)
Interpolate 3 Vectors using Barycentric coordinates.
Declaration
public static void BaryCentric(in Vector4d a, in Vector4d b, in Vector4d c, double u, double v, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First input Vector. |
Vector4d | b | Second input Vector. |
Vector4d | c | Third input Vector. |
double | u | First Barycentric Coordinate. |
double | v | Second Barycentric Coordinate. |
Vector4d | result | Output Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise. |
Ceiling()
Returns a new vector were a component-wise ceiling operation has been applied. Equivalent to calling Ceiling(double) on each component.
Declaration
public readonly Vector4d Ceiling()
Returns
Type | Description |
---|---|
Vector4d | The ceiled vector. |
Ceiling(Vector4d)
Component-wise ceiling operation. Equivalent to calling Ceiling(double) on each component.
Declaration
[Pure]
public static Vector4d Ceiling(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to take the ceiling of. |
Returns
Type | Description |
---|---|
Vector4d | The component-wise ceiling vector. |
Ceiling(in Vector4d, out Vector4d)
Component-wise ceiling operation. Equivalent to calling Ceiling(double) on each component.
Declaration
public static void Ceiling(in Vector4d vec, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to take the ceiling of. |
Vector4d | result | The component-wise ceiling vector. |
Clamp(Vector4d, Vector4d, Vector4d)
Clamp a vector to the given minimum and maximum vectors.
Declaration
[Pure]
public static Vector4d Clamp(Vector4d vec, Vector4d min, Vector4d max)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | Input vector. |
Vector4d | min | Minimum vector. |
Vector4d | max | Maximum vector. |
Returns
Type | Description |
---|---|
Vector4d | The clamped vector. |
Clamp(in Vector4d, in Vector4d, in Vector4d, out Vector4d)
Clamp a vector to the given minimum and maximum vectors.
Declaration
public static void Clamp(in Vector4d vec, in Vector4d min, in Vector4d max, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | Input vector. |
Vector4d | min | Minimum vector. |
Vector4d | max | Maximum vector. |
Vector4d | result | The clamped vector. |
ComponentEqual(in Vector4d, in Vector4d)
Component wise equal comparision of two vectors.
Declaration
public static Vector4b ComponentEqual(in Vector4d left, in Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left vector. |
Vector4d | right | The right vector. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is equal to the right component. |
ComponentMax(Vector4d, Vector4d)
Returns a vector created from the largest of the corresponding components of the given vectors.
Declaration
[Pure]
public static Vector4d ComponentMax(Vector4d a, Vector4d b)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First operand. |
Vector4d | b | Second operand. |
Returns
Type | Description |
---|---|
Vector4d | The component-wise maximum. |
ComponentMax(in Vector4d, in Vector4d, out Vector4d)
Returns a vector created from the largest of the corresponding components of the given vectors.
Declaration
public static void ComponentMax(in Vector4d a, in Vector4d b, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First operand. |
Vector4d | b | Second operand. |
Vector4d | result | The component-wise maximum. |
ComponentMin(Vector4d, Vector4d)
Returns a vector created from the smallest of the corresponding components of the given vectors.
Declaration
[Pure]
public static Vector4d ComponentMin(Vector4d a, Vector4d b)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First operand. |
Vector4d | b | Second operand. |
Returns
Type | Description |
---|---|
Vector4d | The component-wise minimum. |
ComponentMin(in Vector4d, in Vector4d, out Vector4d)
Returns a vector created from the smallest of the corresponding components of the given vectors.
Declaration
public static void ComponentMin(in Vector4d a, in Vector4d b, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First operand. |
Vector4d | b | Second operand. |
Vector4d | result | The component-wise minimum. |
ComponentNotEqual(in Vector4d, in Vector4d)
Component wise not equal comparision of two vectors.
Declaration
public static Vector4b ComponentNotEqual(in Vector4d left, in Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left vector. |
Vector4d | right | The right vector. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is not equal to the right component. |
Deconstruct(out double, out double, out double, out double)
Deconstructs the vector into it's individual components.
Declaration
[Pure]
public readonly void Deconstruct(out double x, out double y, out double z, out double w)
Parameters
Type | Name | Description |
---|---|---|
double | x | The X component of the vector. |
double | y | The Y component of the vector. |
double | z | The Z component of the vector. |
double | w | The W component of the vector. |
Distance(Vector4d, Vector4d)
Compute the euclidean distance between two vectors.
Declaration
[Pure]
public static double Distance(Vector4d vec1, Vector4d vec2)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec1 | The first vector. |
Vector4d | vec2 | The second vector. |
Returns
Type | Description |
---|---|
double | The distance. |
Distance(in Vector4d, in Vector4d, out double)
Compute the euclidean distance between two vectors.
Declaration
public static void Distance(in Vector4d vec1, in Vector4d vec2, out double result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec1 | The first vector. |
Vector4d | vec2 | The second vector. |
double | result | The distance. |
DistanceSquared(Vector4d, Vector4d)
Compute the squared euclidean distance between two vectors.
Declaration
[Pure]
public static double DistanceSquared(Vector4d vec1, Vector4d vec2)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec1 | The first vector. |
Vector4d | vec2 | The second vector. |
Returns
Type | Description |
---|---|
double | The squared distance. |
DistanceSquared(in Vector4d, in Vector4d, out double)
Compute the squared euclidean distance between two vectors.
Declaration
public static void DistanceSquared(in Vector4d vec1, in Vector4d vec2, out double result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec1 | The first vector. |
Vector4d | vec2 | The second vector. |
double | result | The squared distance. |
Divide(Vector4d, Vector4d)
Divides a vector by the components of a vector (scale).
Declaration
[Pure]
public static Vector4d Divide(Vector4d vector, Vector4d scale)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vector | Left operand. |
Vector4d | scale | Right operand. |
Returns
Type | Description |
---|---|
Vector4d | Result of the operation. |
Divide(Vector4d, double)
Divides a vector by a scalar.
Declaration
[Pure]
public static Vector4d Divide(Vector4d vector, double scale)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vector | Left operand. |
double | scale | Right operand. |
Returns
Type | Description |
---|---|
Vector4d | Result of the operation. |
Divide(in Vector4d, in Vector4d, out Vector4d)
Divide a vector by the components of a vector (scale).
Declaration
public static void Divide(in Vector4d vector, in Vector4d scale, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vector | Left operand. |
Vector4d | scale | Right operand. |
Vector4d | result | Result of the operation. |
Divide(in Vector4d, double, out Vector4d)
Divides a vector by a scalar.
Declaration
public static void Divide(in Vector4d vector, double scale, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vector | Left operand. |
double | scale | Right operand. |
Vector4d | result | Result of the operation. |
Dot(Vector4d, Vector4d)
Calculate the dot product of two vectors.
Declaration
[Pure]
public static double Dot(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | First operand. |
Vector4d | right | Second operand. |
Returns
Type | Description |
---|---|
double | The dot product of the two inputs. |
Dot(in Vector4d, in Vector4d, out double)
Calculate the dot product of two vectors.
Declaration
public static void Dot(in Vector4d left, in Vector4d right, out double result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | First operand. |
Vector4d | right | Second operand. |
double | result | The dot product of the two inputs. |
Elerp(Vector4d, Vector4d, float)
Returns a new vector that is the exponential interpolation of the two vectors.
Equivalent to a * pow(b/a, t)
.
Declaration
public static Vector4d Elerp(Vector4d a, Vector4d b, float t)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | The starting value. Must be non-negative. |
Vector4d | b | The end value. Must be non-negative. |
float | t | The blend factor. |
Returns
Type | Description |
---|---|
Vector4d | The exponential interpolation between |
See Also
Elerp(in Vector4d, in Vector4d, float, out Vector4d)
Returns a new vector that is the exponential interpolation of the two vectors.
Equivalent to a * pow(b/a, t)
.
Declaration
public static void Elerp(in Vector4d a, in Vector4d b, float t, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | The starting value. Must be non-negative. |
Vector4d | b | The end value. Must be non-negative. |
float | t | The blend factor. |
Vector4d | result | The exponential interpolation between |
See Also
Equals(Vector4d)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(Vector4d other)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
Floor()
Returns a new vector were a component-wise floor operation has been applied. Equivalent to calling Floor(double) on each component.
Declaration
public readonly Vector4d Floor()
Returns
Type | Description |
---|---|
Vector4d | The floored vector. |
Floor(Vector4d)
Component-wise floor operation. Equivalent to calling Floor(double) on each component.
Declaration
[Pure]
public static Vector4d Floor(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to take the floor of. |
Returns
Type | Description |
---|---|
Vector4d | The component-wise floored vector. |
Floor(in Vector4d, out Vector4d)
Component-wise floor operation. Equivalent to calling Floor(double) on each component.
Declaration
public static void Floor(in Vector4d vec, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to take the floor of. |
Vector4d | result | The component-wise floored vector. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
GreaterThan(in Vector4d, in Vector4d)
Component wise greater than comparision of two vectors.
Declaration
public static Vector4b GreaterThan(in Vector4d left, in Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left vector. |
Vector4d | right | The right vector. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is greater than the right component. |
GreaterThanOrEqual(in Vector4d, in Vector4d)
Component wise greater than or equal comparision of two vectors.
Declaration
public static Vector4b GreaterThanOrEqual(in Vector4d left, in Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left vector. |
Vector4d | right | The right vector. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is greater than or equal to the right component. |
Lerp(Vector4d, Vector4d, Vector4d)
Returns a new vector that is the component-wise linear blend of the 2 given vectors.
Declaration
[Pure]
public static Vector4d Lerp(Vector4d a, Vector4d b, Vector4d blend)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First input vector. |
Vector4d | b | Second input vector. |
Vector4d | blend | The blend factor. |
Returns
Type | Description |
---|---|
Vector4d | a when blend=0, b when blend=1, and a component-wise linear combination otherwise. |
Lerp(Vector4d, Vector4d, double)
Returns a new vector that is the linear blend of the 2 given vectors.
Declaration
[Pure]
public static Vector4d Lerp(Vector4d a, Vector4d b, double blend)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First input vector. |
Vector4d | b | Second input vector. |
double | blend | The blend factor. |
Returns
Type | Description |
---|---|
Vector4d | a when blend=0, b when blend=1, and a linear combination otherwise. |
Lerp(in Vector4d, in Vector4d, Vector4d, out Vector4d)
Returns a new vector that is the component-wise linear blend of the 2 given vectors.
Declaration
public static void Lerp(in Vector4d a, in Vector4d b, Vector4d blend, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First input vector. |
Vector4d | b | Second input vector. |
Vector4d | blend | The blend factor. |
Vector4d | result | a when blend=0, b when blend=1, and a component-wise linear combination otherwise. |
Lerp(in Vector4d, in Vector4d, double, out Vector4d)
Returns a new vector that is the linear blend of the 2 given vectors.
Declaration
public static void Lerp(in Vector4d a, in Vector4d b, double blend, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First input vector. |
Vector4d | b | Second input vector. |
double | blend | The blend factor. |
Vector4d | result | a when blend=0, b when blend=1, and a linear combination otherwise. |
LessThan(in Vector4d, in Vector4d)
Component wise less than comparision of two vectors.
Declaration
public static Vector4b LessThan(in Vector4d left, in Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left vector. |
Vector4d | right | The right vector. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is less than the right component. |
LessThanOrEqual(in Vector4d, in Vector4d)
Component wise less than or equal comparision of two vectors.
Declaration
public static Vector4b LessThanOrEqual(in Vector4d left, in Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left vector. |
Vector4d | right | The right vector. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is less than or equal to the right component. |
MagnitudeMax(Vector4d, Vector4d)
Returns the Vector4d with the minimum magnitude.
Declaration
[Pure]
public static Vector4d MagnitudeMax(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | Left operand. |
Vector4d | right | Right operand. |
Returns
Type | Description |
---|---|
Vector4d | The minimum Vector4d. |
MagnitudeMax(in Vector4d, in Vector4d, out Vector4d)
Returns the Vector4d with the maximum magnitude.
Declaration
public static void MagnitudeMax(in Vector4d left, in Vector4d right, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | Left operand. |
Vector4d | right | Right operand. |
Vector4d | result | The magnitude-wise maximum. |
MagnitudeMin(Vector4d, Vector4d)
Returns the Vector4d with the minimum magnitude.
Declaration
[Pure]
public static Vector4d MagnitudeMin(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | Left operand. |
Vector4d | right | Right operand. |
Returns
Type | Description |
---|---|
Vector4d | The minimum Vector4d. |
MagnitudeMin(in Vector4d, in Vector4d, out Vector4d)
Returns the Vector4d with the minimum magnitude.
Declaration
public static void MagnitudeMin(in Vector4d left, in Vector4d right, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | Left operand. |
Vector4d | right | Right operand. |
Vector4d | result | The magnitude-wise minimum. |
Multiply(Vector4d, Vector4d)
Multiplies a vector by the components a vector (scale).
Declaration
[Pure]
public static Vector4d Multiply(Vector4d vector, Vector4d scale)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vector | Left operand. |
Vector4d | scale | Right operand. |
Returns
Type | Description |
---|---|
Vector4d | Result of the operation. |
Multiply(Vector4d, double)
Multiplies a vector by a scalar.
Declaration
[Pure]
public static Vector4d Multiply(Vector4d vector, double scale)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vector | Left operand. |
double | scale | Right operand. |
Returns
Type | Description |
---|---|
Vector4d | Result of the operation. |
Multiply(in Vector4d, in Vector4d, out Vector4d)
Multiplies a vector by the components of a vector (scale).
Declaration
public static void Multiply(in Vector4d vector, in Vector4d scale, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vector | Left operand. |
Vector4d | scale | Right operand. |
Vector4d | result | Result of the operation. |
Multiply(in Vector4d, double, out Vector4d)
Multiplies a vector by a scalar.
Declaration
public static void Multiply(in Vector4d vector, double scale, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vector | Left operand. |
double | scale | Right operand. |
Vector4d | result | Result of the operation. |
Normalize()
Scales the Vector4d to unit length.
Declaration
public void Normalize()
Normalize(Vector4d)
Scale a vector to unit length.
Declaration
[Pure]
public static Vector4d Normalize(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The input vector. |
Returns
Type | Description |
---|---|
Vector4d | The normalized copy. |
Normalize(in Vector4d, out Vector4d)
Scale a vector to unit length.
Declaration
public static void Normalize(in Vector4d vec, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The input vector. |
Vector4d | result | The normalized vector. |
NormalizeFast()
Scales the Vector4d to approximately unit length.
Declaration
public void NormalizeFast()
NormalizeFast(Vector4d)
Scale a vector to approximately unit length.
Declaration
[Pure]
public static Vector4d NormalizeFast(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The input vector. |
Returns
Type | Description |
---|---|
Vector4d | The normalized copy. |
NormalizeFast(in Vector4d, out Vector4d)
Scale a vector to approximately unit length.
Declaration
public static void NormalizeFast(in Vector4d vec, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The input vector. |
Vector4d | result | The normalized vector. |
Normalized()
Returns a copy of the Vector4d scaled to unit length.
Declaration
public readonly Vector4d Normalized()
Returns
Type | Description |
---|---|
Vector4d | The normalized copy. |
Round()
Returns a new vector were component-wise rounding has been applied. Equivalent to calling Round(double) on each component.
Declaration
public readonly Vector4d Round()
Returns
Type | Description |
---|---|
Vector4d | The rounded vector. |
Round(Vector4d)
Component-wise rounding. Equivalent to calling Round(double) on each component.
Declaration
[Pure]
public static Vector4d Round(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to round. |
Returns
Type | Description |
---|---|
Vector4d | The component-wise rounded vector. |
Round(Vector4d, MidpointRounding)
Component-wise rounding with specified midpoint rounding rule. Equivalent to calling Round(double, MidpointRounding) on each component.
Declaration
[Pure]
public static Vector4d Round(Vector4d vec, MidpointRounding rounding)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to round. |
MidpointRounding | rounding | The midpoint rounding rule to use. |
Returns
Type | Description |
---|---|
Vector4d | The component-wise rounded vector. |
Round(in Vector4d, out Vector4d)
Component-wise rounding. Equivalent to calling Round(double) on each component.
Declaration
public static void Round(in Vector4d vec, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to round. |
Vector4d | result | The component-wise rounded vector. |
Round(in Vector4d, MidpointRounding, out Vector4d)
Component-wise rounding with specified midpoint rounding rule. Equivalent to calling Round(double, MidpointRounding) on each component.
Declaration
public static void Round(in Vector4d vec, MidpointRounding rounding, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to round. |
MidpointRounding | rounding | The midpoint rounding rule to use. |
Vector4d | result | The component-wise rounded vector. |
Round(MidpointRounding)
Returns a new vector were component-wise rounding has been applied with the specified midpoint rounding rule. Equivalent to calling Round(double, MidpointRounding) on each component.
Declaration
public readonly Vector4d Round(MidpointRounding rounding)
Parameters
Type | Name | Description |
---|---|---|
MidpointRounding | rounding | The midpoint rounding rule to use. |
Returns
Type | Description |
---|---|
Vector4d | The rounded vector. |
Slerp(Vector4d, Vector4d, double)
Returns a new vector that is the spherical interpolation of the two given vectors.
a
and b
need to be normalized for this function to work properly.
Results are undefined for vectors that point in opposite directions or very close to opposite directions.
Declaration
[Pure]
public static Vector4d Slerp(Vector4d a, Vector4d b, double t)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | Unit vector start point. |
Vector4d | b | Unit vector end point. |
double | t | The blend factor. |
Returns
Type | Description |
---|---|
Vector4d |
|
Slerp(in Vector4d, in Vector4d, double, out Vector4d)
Returns a new vector that is the spherical interpolation of the two given vectors.
a
and b
need to be normalized for this function to work properly.
Results are undefined for vectors that point in opposite directions or very close to opposite directions.
Declaration
public static void Slerp(in Vector4d a, in Vector4d b, double t, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | Unit vector start point. |
Vector4d | b | Unit vector end point. |
double | t | The blend factor. |
Vector4d | result | Is |
Subtract(Vector4d, Vector4d)
Subtract one Vector from another.
Declaration
[Pure]
public static Vector4d Subtract(Vector4d a, Vector4d b)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First operand. |
Vector4d | b | Second operand. |
Returns
Type | Description |
---|---|
Vector4d | Result of the subtraction. |
Subtract(in Vector4d, in Vector4d, out Vector4d)
Subtract one Vector from another.
Declaration
public static void Subtract(in Vector4d a, in Vector4d b, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | a | First operand. |
Vector4d | b | Second operand. |
Vector4d | result | Result of subtraction. |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
ToString(IFormatProvider)
Formats the value of the current instance using the specified format.
Declaration
public readonly string ToString(IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
IFormatProvider | formatProvider | The provider to use to format the value. -or- A null reference ( |
Returns
Type | Description |
---|---|
string | The value of the current instance in the specified format. |
ToString(string)
Formats the value of the current instance using the specified format.
Declaration
public readonly string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
string | format | The format to use. -or- A null reference ( |
Returns
Type | Description |
---|---|
string | The value of the current instance in the specified format. |
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
Declaration
public readonly string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
string | format | The format to use. -or- A null reference ( |
IFormatProvider | formatProvider | The provider to use to format the value. -or- A null reference ( |
Returns
Type | Description |
---|---|
string | The value of the current instance in the specified format. |
Transform(Vector4d, Quaterniond)
Transforms a vector by a quaternion rotation.
Declaration
[Pure]
public static Vector4d Transform(Vector4d vec, Quaterniond quat)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Quaterniond | quat | The quaternion to rotate the vector by. |
Returns
Type | Description |
---|---|
Vector4d | The result of the operation. |
Transform(in Vector4d, in Quaterniond, out Vector4d)
Transforms a vector by a quaternion rotation.
Declaration
public static void Transform(in Vector4d vec, in Quaterniond quat, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Quaterniond | quat | The quaternion to rotate the vector by. |
Vector4d | result | The result of the operation. |
TransformColumn(Matrix4d, Vector4d)
Transform a Vector by the given Matrix using right-handed notation.
Declaration
[Pure]
public static Vector4d TransformColumn(Matrix4d mat, Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Matrix4d | mat | The desired transformation. |
Vector4d | vec | The vector to transform. |
Returns
Type | Description |
---|---|
Vector4d | The transformed vector. |
TransformColumn(in Matrix4d, in Vector4d, out Vector4d)
Transform a Vector by the given Matrix using right-handed notation.
Declaration
public static void TransformColumn(in Matrix4d mat, in Vector4d vec, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix4d | mat | The desired transformation. |
Vector4d | vec | The vector to transform. |
Vector4d | result | The transformed vector. |
TransformRow(Vector4d, Matrix4d)
Transform a Vector by the given Matrix using right-handed notation.
Declaration
[Pure]
public static Vector4d TransformRow(Vector4d vec, Matrix4d mat)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4d | mat | The desired transformation. |
Returns
Type | Description |
---|---|
Vector4d | The transformed vector. |
TransformRow(in Vector4d, in Matrix4d, out Vector4d)
Transform a Vector by the given Matrix.
Declaration
public static void TransformRow(in Vector4d vec, in Matrix4d mat, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4d | mat | The desired transformation. |
Vector4d | result | The transformed vector. |
TransformThreeDimensionsColumn(Matrix3x4d, Vector4d)
Transform a 4-dimensional vector into a 2-dimensional vector using the given 2x4 Matrix.
Declaration
[Pure]
public static Vector3d TransformThreeDimensionsColumn(Matrix3x4d mat, Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x4d | mat | The desired transformation. |
Vector4d | vec | The vector to transform. |
Returns
Type | Description |
---|---|
Vector3d | The transformed vector. |
TransformThreeDimensionsColumn(in Matrix3x4d, in Vector4d, out Vector3d)
Transform a 4-dimensional vector into a 2-dimensional vector using the given 2x4 Matrix.
Declaration
public static void TransformThreeDimensionsColumn(in Matrix3x4d mat, in Vector4d vec, out Vector3d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x4d | mat | The desired transformation. |
Vector4d | vec | The vector to transform. |
Vector3d | result | The transformed vector. |
TransformThreeDimensionsRow(Vector4d, Matrix4x3d)
Transform a 4-dimensional vector into a 3-dimensional vector using the given 4x3 Matrix.
Declaration
[Pure]
public static Vector3d TransformThreeDimensionsRow(Vector4d vec, Matrix4x3d mat)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4x3d | mat | The desired transformation. |
Returns
Type | Description |
---|---|
Vector3d | The transformed vector. |
TransformThreeDimensionsRow(in Vector4d, in Matrix4x3d, out Vector3d)
Transform a 4-dimensional vector into a 3-dimensional vector using the given 4x3 Matrix.
Declaration
public static void TransformThreeDimensionsRow(in Vector4d vec, in Matrix4x3d mat, out Vector3d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4x3d | mat | The desired transformation. |
Vector3d | result | The transformed vector. |
TransformTwoDimensionsColumn(Matrix2x4d, Vector4d)
Transform a 4-dimensional vector into a 2-dimensional vector using the given 2x4 Matrix.
Declaration
[Pure]
public static Vector2d TransformTwoDimensionsColumn(Matrix2x4d mat, Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | mat | The desired transformation. |
Vector4d | vec | The vector to transform. |
Returns
Type | Description |
---|---|
Vector2d | The transformed vector. |
TransformTwoDimensionsColumn(in Matrix2x4d, in Vector4d, out Vector2d)
Transform a 4-dimensional vector into a 2-dimensional vector using the given 2x4 Matrix.
Declaration
public static void TransformTwoDimensionsColumn(in Matrix2x4d mat, in Vector4d vec, out Vector2d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | mat | The desired transformation. |
Vector4d | vec | The vector to transform. |
Vector2d | result | The transformed vector. |
TransformTwoDimensionsRow(Vector4d, Matrix4x2d)
Transform a 4-dimensional vector into a 2-dimensional vector using the given 4x2 Matrix.
Declaration
[Pure]
public static Vector2d TransformTwoDimensionsRow(Vector4d vec, Matrix4x2d mat)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4x2d | mat | The desired transformation. |
Returns
Type | Description |
---|---|
Vector2d | The transformed vector. |
TransformTwoDimensionsRow(in Vector4d, in Matrix4x2d, out Vector2d)
Transform a 4-dimensional vector into a 2-dimensional vector using the given 4x2 Matrix.
Declaration
public static void TransformTwoDimensionsRow(in Vector4d vec, in Matrix4x2d mat, out Vector2d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4x2d | mat | The desired transformation. |
Vector2d | result | The transformed vector. |
Truncate()
Returns a new vector were component-wise truncation has been applied. Equivalent to calling Truncate(double) on each component.
Declaration
public readonly Vector4d Truncate()
Returns
Type | Description |
---|---|
Vector4d | The truncated vector. |
Truncate(Vector4d)
Component-wise truncation. Equivalent to calling Truncate(double) on each component.
Declaration
[Pure]
public static Vector4d Truncate(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to truncate. |
Returns
Type | Description |
---|---|
Vector4d | The component-wise truncated vector. |
Truncate(in Vector4d, out Vector4d)
Component-wise truncation. Equivalent to calling Truncate(double) on each component.
Declaration
public static void Truncate(in Vector4d vec, out Vector4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to truncate. |
Vector4d | result | The component-wise truncated vector. |
Operators
operator +(Vector4d, Vector4d)
Adds two instances.
Declaration
[Pure]
public static Vector4d operator +(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The first instance. |
Vector4d | right | The second instance. |
Returns
Type | Description |
---|---|
Vector4d | The result of the calculation. |
operator +(Vector4d, double)
Adds a scalar to an instance.
Declaration
[Pure]
public static Vector4d operator +(Vector4d left, double right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The instance. |
double | right | The scalar. |
Returns
Type | Description |
---|---|
Vector4d | The result of the operation. |
operator +(double, Vector4d)
Adds a scalar to an instance.
Declaration
[Pure]
public static Vector4d operator +(double left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
double | left | The scalar. |
Vector4d | right | The instance. |
Returns
Type | Description |
---|---|
Vector4d | The result of the operation. |
operator /(Vector4d, Vector4d)
Component-wise division between the specified instance by a scale vector.
Declaration
[Pure]
public static Vector4d operator /(Vector4d vec, Vector4d scale)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | Left operand. |
Vector4d | scale | Right operand. |
Returns
Type | Description |
---|---|
Vector4d | Result of the division. |
operator /(Vector4d, double)
Divides an instance by a scalar.
Declaration
[Pure]
public static Vector4d operator /(Vector4d vec, double scale)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The instance. |
double | scale | The scalar. |
Returns
Type | Description |
---|---|
Vector4d | Result of the division. |
operator /(double, Vector4d)
Divides a scalar by an instance.
Declaration
[Pure]
public static Vector4d operator /(double left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
double | left | The scalar. |
Vector4d | right | The instance. |
Returns
Type | Description |
---|---|
Vector4d | Result of the division. |
operator ==(Vector4d, Vector4d)
Compares two instances for equality.
Declaration
public static bool operator ==(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The first instance. |
Vector4d | right | The second instance. |
Returns
Type | Description |
---|---|
bool | True, if left equals right; false otherwise. |
explicit operator Vector4(Vector4d)
Converts OpenTK.Vector4d to OpenTK.Vector4.
Declaration
[Pure]
public static explicit operator Vector4(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The Vector4d to convert. |
Returns
Type | Description |
---|---|
Vector4 | The resulting Vector4. |
explicit operator Vector4h(Vector4d)
Converts OpenTK.Vector4d to OpenTK.Vector4h.
Declaration
[Pure]
public static explicit operator Vector4h(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The Vector4d to convert. |
Returns
Type | Description |
---|---|
Vector4h | The resulting Vector4h. |
explicit operator Vector4i(Vector4d)
Converts OpenTK.Vector4d to OpenTK.Vector4i.
Declaration
[Pure]
public static explicit operator Vector4i(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The Vector4d to convert. |
Returns
Type | Description |
---|---|
Vector4i | The resulting Vector4i. |
operator >(Vector4d, Vector4d)
Component wise greater than comparision between the specified instances.
Declaration
[Pure]
public static Vector4b operator >(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left instance. |
Vector4d | right | The right instance. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding greater component is greater than the right component. |
operator >=(Vector4d, Vector4d)
Component wise greater than or equal comparision between the specified instances.
Declaration
[Pure]
public static Vector4b operator >=(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left instance. |
Vector4d | right | The right instance. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is greater than or equal the right component. |
implicit operator Vector4d((double X, double Y, double Z, double W))
Initializes a new instance of the Vector4d struct using a tuple containing the component values.
Declaration
[Pure]
public static implicit operator Vector4d((double X, double Y, double Z, double W) values)
Parameters
Type | Name | Description |
---|---|---|
(double X, double Y, double Z, double W) | values | A tuple containing the component values. |
Returns
Type | Description |
---|---|
Vector4d | A new instance of the Vector4d struct with the given component values. |
operator !=(Vector4d, Vector4d)
Compares two instances for inequality.
Declaration
public static bool operator !=(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The first instance. |
Vector4d | right | The second instance. |
Returns
Type | Description |
---|---|
bool | True, if left does not equa lright; false otherwise. |
operator <(Vector4d, Vector4d)
Component wise less than comparision between the specified instances.
Declaration
[Pure]
public static Vector4b operator <(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left instance. |
Vector4d | right | The right instance. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is less than the right component. |
operator <=(Vector4d, Vector4d)
Component wise less than or equal comparision between the specified instances.
Declaration
[Pure]
public static Vector4b operator <=(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The left instance. |
Vector4d | right | The right instance. |
Returns
Type | Description |
---|---|
Vector4b | A component wise boolean vector whose compoennts are true when the corresponding left component is less than or equal the right component. |
operator *(Vector4d, Matrix4d)
Transform a Vector by the given Matrix.
Declaration
[Pure]
public static Vector4d operator *(Vector4d vec, Matrix4d mat)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4d | mat | The desired transformation. |
Returns
Type | Description |
---|---|
Vector4d | The transformed vector. |
operator *(Vector4d, Matrix4x2d)
Transform a 4-dimensional vector into a 2-dimensional vector using the given 4x2 Matrix.
Declaration
public static Vector2d operator *(Vector4d vec, Matrix4x2d mat)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4x2d | mat | The desired transformation. |
Returns
Type | Description |
---|---|
Vector2d | The transformed vector. |
operator *(Vector4d, Matrix4x3d)
Transform a 4-dimensional vector into a 3-dimensional vector using the given 4x3 Matrix.
Declaration
public static Vector3d operator *(Vector4d vec, Matrix4x3d mat)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The vector to transform. |
Matrix4x3d | mat | The desired transformation. |
Returns
Type | Description |
---|---|
Vector3d | The transformed vector. |
operator *(Vector4d, Vector4d)
Component-wise multiplication between the specified instance by a scale vector.
Declaration
[Pure]
public static Vector4d operator *(Vector4d vec, Vector4d scale)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | Right operand. |
Vector4d | scale | Left operand. |
Returns
Type | Description |
---|---|
Vector4d | Result of the multiplication. |
operator *(Vector4d, double)
Multiplies an instance by a scalar.
Declaration
[Pure]
public static Vector4d operator *(Vector4d vec, double scale)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The instance. |
double | scale | The scalar. |
Returns
Type | Description |
---|---|
Vector4d | The result of the calculation. |
operator *(double, Vector4d)
Multiplies an instance by a scalar.
Declaration
[Pure]
public static Vector4d operator *(double scale, Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
double | scale | The scalar. |
Vector4d | vec | The instance. |
Returns
Type | Description |
---|---|
Vector4d | The result of the calculation. |
operator -(Vector4d, Vector4d)
Subtracts two instances.
Declaration
[Pure]
public static Vector4d operator -(Vector4d left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The first instance. |
Vector4d | right | The second instance. |
Returns
Type | Description |
---|---|
Vector4d | The result of the calculation. |
operator -(Vector4d, double)
Subtracts an instance by a scalar.
Declaration
[Pure]
public static Vector4d operator -(Vector4d left, double right)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | left | The instance. |
double | right | The scalar. |
Returns
Type | Description |
---|---|
Vector4d | The result of the operation. |
operator -(double, Vector4d)
Subtracts a scalar by an instance.
Declaration
[Pure]
public static Vector4d operator -(double left, Vector4d right)
Parameters
Type | Name | Description |
---|---|---|
double | left | The scalar. |
Vector4d | right | The instance. |
Returns
Type | Description |
---|---|
Vector4d | The result of the operation. |
operator -(Vector4d)
Negates an instance.
Declaration
[Pure]
public static Vector4d operator -(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The instance. |
Returns
Type | Description |
---|---|
Vector4d | The result of the calculation. |
operator +(Vector4d)
Computes the unary plus of the vector.
Declaration
[Pure]
public static Vector4d operator +(Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | vec | The instance. |
Returns
Type | Description |
---|---|
Vector4d | The result of the calculation. |