Struct Vector4d
Represents a 4D vector using four double-precision floating-point numbers.
Inherited Members
Namespace: OpenTK.Mathematics
Assembly: OpenTK.Mathematics.dll
Syntax
[Serializable]
public struct Vector4d : IEquatable<Vector4d>, IFormattable
Remarks
The Vector4 structure is suitable for interoperation with unmanaged code requiring four consecutive doubles.
Constructors
Vector4d(Vector2d)
Initializes a new instance of the Vector4d struct.
Declaration
public Vector4d(Vector2d v)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | v | The Vector2d to copy components from. |
Vector4d(Vector3d, double)
Initializes a new instance of the Vector4d struct.
Declaration
public Vector4d(Vector3d v, double w)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | The Vector3d to copy components from. |
double | w | The w component of the new Vector4. |
Vector4d(Vector3d)
Initializes a new instance of the Vector4d struct.
Declaration
public Vector4d(Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | The Vector3d to copy components from. |
Remarks
Vector4d(Vector4d)
Initializes a new instance of the Vector4d struct.
Declaration
public Vector4d(Vector4d v)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | v | The Vector4d to copy components from. |
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. |
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. |
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
this[int]
Gets or sets the value at the index of the Vector.
Declaration
public double this[int index] { 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 double Length { get; }
Property Value
Type | Description |
---|---|
double |
See Also
LengthFast
Gets an approximation of the vector length (magnitude).
Declaration
public double LengthFast { get; }
Property Value
Type | Description |
---|---|
double |
Remarks
This property uses an approximation of the square root function to calculate vector magnitude, with an upper error bound of 0.001.
See Also
LengthSquared
Gets the square of the vector length (magnitude).
Declaration
public 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.
Wx
Gets or sets an OpenTK.Vector2d with the W and X components of this instance.
Declaration
public Vector2d Wx { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { get; set; }
Property Value
Type | Description |
---|---|
Vector4d |
Methods
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. |
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. |
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. |
Deconstruct(out double, out double, out double, out double)
Deconstructs the vector into it's individual components.
Declaration
[Pure]
public 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. |
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. |
Equals(Vector4d)
Declaration
public bool Equals(Vector4d other)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | other |
Returns
Type | Description |
---|---|
bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
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. |
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. |
Normalized()
Returns a copy of the Vector4d scaled to unit length.
Declaration
public Vector4d Normalized()
Returns
Type | Description |
---|---|
Vector4d | The normalized copy. |
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. |
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 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()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
ToString(IFormatProvider)
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
string |
ToString(string, IFormatProvider)
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
string | format | |
IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
string |
ToString(string)
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
string | format |
Returns
Type | Description |
---|---|
string |
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. |
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, 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 | The result of the calculation. |
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. |
explicit operator double*(Vector4d)
Returns a pointer to the first element of the specified instance.
Declaration
[Pure]
public static explicit operator double*(Vector4d v)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | v | The instance. |
Returns
Type | Description |
---|---|
double* | A pointer to the first element of v. |
explicit operator IntPtr(Vector4d)
Returns a pointer to the first element of the specified instance.
Declaration
[Pure]
public static explicit operator IntPtr(Vector4d v)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | v | The instance. |
Returns
Type | Description |
---|---|
IntPtr | A pointer to the first element of v. |
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 *(Matrix4d, Vector4d)
Transform a Vector by the given Matrix using right-handed notation.
Declaration
[Pure]
public static Vector4d operator *(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. |
operator *(Quaterniond, Vector4d)
Transforms a vector by a quaternion rotation.
Declaration
[Pure]
public static Vector4d operator *(Quaterniond quat, Vector4d vec)
Parameters
Type | Name | Description |
---|---|---|
Quaterniond | quat | The quaternion to rotate the vector by. |
Vector4d | vec | The vector to transform. |
Returns
Type | Description |
---|---|
Vector4d | The transformed vector. |
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, 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 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)
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. |