Show / Hide Table of Contents

Struct Vector4d

Represents a 4D vector using four double-precision floating-point numbers.

Implements
IEquatable<Vector4d>
Inherited Members
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Namespace: OpenTK
Assembly: OpenTK.dll
Syntax
[Serializable]
public struct Vector4d : IEquatable<Vector4d>

Constructors

Vector4d(Vector2d)

Constructs a new Vector4d from the given Vector2d.

Declaration
public Vector4d(Vector2d v)
Parameters
Type Name Description
Vector2d v

The Vector2d to copy components from.

Vector4d(Vector3d)

Constructs a new Vector4d from the given Vector3d. The w component is initialized to 0.

Declaration
public Vector4d(Vector3d v)
Parameters
Type Name Description
Vector3d v

The Vector3d to copy components from.

Remarks

Vector4d(Vector3d, Double)

Vector4d(Vector3d, Double)

Constructs a new Vector4d from the specified Vector3d and w component.

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(Vector4d)

Constructs a new Vector4d from the given Vector4d.

Declaration
public Vector4d(Vector4d v)
Parameters
Type Name Description
Vector4d v

The Vector4d to copy components from.

Vector4d(Double)

Constructs a new instance.

Declaration
public Vector4d(double value)
Parameters
Type Name Description
Double value

The value that will initialize this instance.

Vector4d(Double, Double, Double, Double)

Constructs a new Vector4d.

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

One

Defines an instance with all components set to 1.

Declaration
public static readonly Vector4d One
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
Int32

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 a zero-length Vector4d.

Declaration
public static readonly Vector4d Zero
Field Value
Type Description
Vector4d

Properties

Item[Int32]

Gets or sets the value at the index of the Vector.

Declaration
public double this[int index] { get; set; }
Parameters
Type Name Description
Int32 index
Property Value
Type Description
Double

Length

Gets the length (magnitude) of the vector.

Declaration
public readonly double Length { get; }
Property Value
Type Description
Double
See Also
LengthSquared

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, with an upper error bound of 0.001.

See Also
LengthSquared

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.

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 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 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 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 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 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 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
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(ref Vector4d, ref Vector4d, out Vector4d)

Adds two vectors.

Declaration
public static void Add(ref Vector4d a, ref 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
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(ref Vector4d, ref Vector4d, ref Vector4d, Double, Double, out Vector4d)

Interpolate 3 Vectors using Barycentric coordinates

Declaration
public static void BaryCentric(ref Vector4d a, ref Vector4d b, ref 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
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(ref Vector4d, ref Vector4d, ref Vector4d, out Vector4d)

Clamp a vector to the given minimum and maximum vectors

Declaration
public static void Clamp(ref Vector4d vec, ref Vector4d min, ref 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
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(ref Vector4d, ref Vector4d, out Vector4d)

Returns a vector created from the largest of the corresponding components of the given vectors.

Declaration
public static void ComponentMax(ref Vector4d a, ref 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
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(ref Vector4d, ref Vector4d, out Vector4d)

Returns a vector created from the smallest of the corresponding components of the given vectors.

Declaration
public static void ComponentMin(ref Vector4d a, ref Vector4d b, out Vector4d result)
Parameters
Type Name Description
Vector4d a

First operand

Vector4d b

Second operand

Vector4d result

The component-wise minimum

Divide(Vector4d, Vector4d)

Divides a vector by the components of a vector (scale).

Declaration
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
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(ref Vector4d, ref Vector4d, out Vector4d)

Divide a vector by the components of a vector (scale).

Declaration
public static void Divide(ref Vector4d vector, ref Vector4d scale, out Vector4d result)
Parameters
Type Name Description
Vector4d vector

Left operand.

Vector4d scale

Right operand.

Vector4d result

Result of the operation.

Divide(ref Vector4d, Double, out Vector4d)

Divides a vector by a scalar.

Declaration
public static void Divide(ref 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
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(ref Vector4d, ref Vector4d, out Double)

Calculate the dot product of two vectors

Declaration
public static void Dot(ref Vector4d left, ref 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)

Indicates whether the current vector is equal to another vector.

Declaration
public bool Equals(Vector4d other)
Parameters
Type Name Description
Vector4d other

A vector to compare with this vector.

Returns
Type Description
Boolean

true if the current vector is equal to the vector parameter; otherwise, false.

Equals(Object)

Indicates whether this instance and a specified object are equal.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj

The object to compare to.

Returns
Type Description
Boolean

True if the instances are equal; false otherwise.

Overrides
ValueType.Equals(Object)

GetHashCode()

Returns the hashcode for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

A System.Int32 containing the unique hashcode for this instance.

Overrides
ValueType.GetHashCode()

Lerp(Vector4d, Vector4d, Double)

Returns a new Vector that is the linear blend of the 2 given Vectors

Declaration
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. a when blend=0, b when blend=1.

Returns
Type Description
Vector4d

a when blend=0, b when blend=1, and a linear combination otherwise

Lerp(ref Vector4d, ref Vector4d, Double, out Vector4d)

Returns a new Vector that is the linear blend of the 2 given Vectors

Declaration
public static void Lerp(ref Vector4d a, ref 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. a when blend=0, b when blend=1.

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
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(ref Vector4d, ref Vector4d, out Vector4d)

Returns the Vector4d with the maximum magnitude

Declaration
public static void MagnitudeMax(ref Vector4d left, ref 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
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(ref Vector4d, ref Vector4d, out Vector4d)

Returns the Vector4d with the minimum magnitude

Declaration
public static void MagnitudeMin(ref Vector4d left, ref Vector4d right, out Vector4d result)
Parameters
Type Name Description
Vector4d left

Left operand

Vector4d right

Right operand

Vector4d result

The magnitude-wise minimum

Max(Vector4d, Vector4d)

Calculate the component-wise maximum of two vectors

Declaration
[Obsolete("Use ComponentMax() instead.")]
public static Vector4d Max(Vector4d a, Vector4d b)
Parameters
Type Name Description
Vector4d a

First operand

Vector4d b

Second operand

Returns
Type Description
Vector4d

The component-wise maximum

Max(ref Vector4d, ref Vector4d, out Vector4d)

Calculate the component-wise maximum of two vectors

Declaration
[Obsolete("Use ComponentMax() instead.")]
public static void Max(ref Vector4d a, ref Vector4d b, out Vector4d result)
Parameters
Type Name Description
Vector4d a

First operand

Vector4d b

Second operand

Vector4d result

The component-wise maximum

Min(Vector4d, Vector4d)

Calculate the component-wise minimum of two vectors

Declaration
[Obsolete("Use ComponentMin() instead.")]
public static Vector4d Min(Vector4d a, Vector4d b)
Parameters
Type Name Description
Vector4d a

First operand

Vector4d b

Second operand

Returns
Type Description
Vector4d

The component-wise minimum

Min(ref Vector4d, ref Vector4d, out Vector4d)

Calculate the component-wise minimum of two vectors

Declaration
[Obsolete("Use ComponentMin() instead.")]
public static void Min(ref Vector4d a, ref Vector4d b, out Vector4d result)
Parameters
Type Name Description
Vector4d a

First operand

Vector4d b

Second operand

Vector4d result

The component-wise minimum

Multiply(Vector4d, Vector4d)

Multiplies a vector by the components a vector (scale).

Declaration
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
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(ref Vector4d, ref Vector4d, out Vector4d)

Multiplies a vector by the components of a vector (scale).

Declaration
public static void Multiply(ref Vector4d vector, ref Vector4d scale, out Vector4d result)
Parameters
Type Name Description
Vector4d vector

Left operand.

Vector4d scale

Right operand.

Vector4d result

Result of the operation.

Multiply(ref Vector4d, Double, out Vector4d)

Multiplies a vector by a scalar.

Declaration
public static void Multiply(ref 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
public static Vector4d Normalize(Vector4d vec)
Parameters
Type Name Description
Vector4d vec

The input vector

Returns
Type Description
Vector4d

The normalized vector

Normalize(ref Vector4d, out Vector4d)

Scale a vector to unit length

Declaration
public static void Normalize(ref 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

NormalizeFast()

Scales the Vector4d to approximately unit length.

Declaration
public void NormalizeFast()

NormalizeFast(Vector4d)

Scale a vector to approximately unit length

Declaration
public static Vector4d NormalizeFast(Vector4d vec)
Parameters
Type Name Description
Vector4d vec

The input vector

Returns
Type Description
Vector4d

The normalized vector

NormalizeFast(ref Vector4d, out Vector4d)

Scale a vector to approximately unit length

Declaration
public static void NormalizeFast(ref 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
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(ref Vector4d, ref Vector4d, out Vector4d)

Subtract one Vector from another

Declaration
public static void Subtract(ref Vector4d a, ref Vector4d b, out Vector4d result)
Parameters
Type Name Description
Vector4d a

First operand

Vector4d b

Second operand

Vector4d result

Result of subtraction

ToString()

Returns a System.String that represents the current Vector4d.

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
ValueType.ToString()

Transform(Vector4d, Matrix4d)

Transform a Vector by the given Matrix

Declaration
public static Vector4d Transform(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

Transform(Vector4d, Quaterniond)

Transforms a vector by a quaternion rotation.

Declaration
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(ref Vector4d, ref Matrix4d, out Vector4d)

Transform a Vector by the given Matrix

Declaration
public static void Transform(ref Vector4d vec, ref 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

Transform(ref Vector4d, ref Quaterniond, out Vector4d)

Transforms a vector by a quaternion rotation.

Declaration
public static void Transform(ref Vector4d vec, ref 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.

Operators

Addition(Vector4d, Vector4d)

Adds two instances.

Declaration
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.

Division(Vector4d, Double)

Divides an instance by a scalar.

Declaration
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.

Equality(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
Boolean

True, if left equals right; false otherwise.

Explicit(Vector4 to Vector4d)

Converts OpenTK.Vector4 to OpenTK.Vector4d.

Declaration
public static explicit operator Vector4d(Vector4 v4)
Parameters
Type Name Description
Vector4 v4

The Vector4 to convert.

Returns
Type Description
Vector4d

The resulting Vector4d.

Explicit(Vector4d to Vector4)

Converts OpenTK.Vector4d to OpenTK.Vector4.

Declaration
public static explicit operator Vector4(Vector4d v4d)
Parameters
Type Name Description
Vector4d v4d

The Vector4d to convert.

Returns
Type Description
Vector4

The resulting Vector4.

Explicit(Vector4d to Double*)

Returns a pointer to the first element of the specified instance.

Declaration
[CLSCompliant(false)]
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(Vector4d to IntPtr)

Returns a pointer to the first element of the specified instance.

Declaration
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.

Inequality(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
Boolean

True, if left does not equa lright; false otherwise.

Multiply(Vector4d, Vector4d)

Component-wise multiplication between the specified instance by a scale vector.

Declaration
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.

Multiply(Vector4d, Double)

Multiplies an instance by a scalar.

Declaration
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.

Multiply(Double, Vector4d)

Multiplies an instance by a scalar.

Declaration
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.

Subtraction(Vector4d, Vector4d)

Subtracts two instances.

Declaration
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.

UnaryNegation(Vector4d)

Negates an instance.

Declaration
public static Vector4d operator -(Vector4d vec)
Parameters
Type Name Description
Vector4d vec

The instance.

Returns
Type Description
Vector4d

The result of the calculation.

Implements

System.IEquatable<T>
In This Article
Back to top Generated by DocFX