The Open Toolkit library  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
OpenTK.Vector3d Struct Reference

Represents a 3D vector using three double-precision floating-point numbers. More...

Inherits IEquatable< Vector3d >.

Public Member Functions

 Vector3d (double value)
 Constructs a new instance. More...
 
 Vector3d (double x, double y, double z)
 Constructs a new Vector3. More...
 
 Vector3d (Vector2d v)
 Constructs a new instance from the given Vector2d. More...
 
 Vector3d (Vector3d v)
 Constructs a new instance from the given Vector3d. More...
 
 Vector3d (Vector4d v)
 Constructs a new instance from the given Vector4d. More...
 
void Add (Vector3d right)
 Add the Vector passed as parameter to this instance. More...
 
void Add (ref Vector3d right)
 Add the Vector passed as parameter to this instance. More...
 
void Sub (Vector3d right)
 Subtract the Vector passed as parameter from this instance. More...
 
void Sub (ref Vector3d right)
 Subtract the Vector passed as parameter from this instance. More...
 
void Mult (double f)
 Multiply this instance by a scalar. More...
 
void Div (double f)
 Divide this instance by a scalar. More...
 
Vector3d Normalized ()
 Returns a copy of the Vector3d scaled to unit length. More...
 
void Normalize ()
 Scales the Vector3d to unit length. More...
 
void NormalizeFast ()
 Scales the Vector3d to approximately unit length. More...
 
void Scale (double sx, double sy, double sz)
 Scales the current Vector3d by the given amounts. More...
 
void Scale (Vector3d scale)
 Scales this instance by the given parameter. More...
 
void Scale (ref Vector3d scale)
 Scales this instance by the given parameter. More...
 
override string ToString ()
 Returns a System.String that represents the current Vector3. More...
 
override int GetHashCode ()
 Returns the hashcode for this instance. More...
 
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal. More...
 
bool Equals (Vector3d other)
 Indicates whether the current vector is equal to another vector. More...
 

Static Public Member Functions

static Vector3d Sub (Vector3d a, Vector3d b)
 Subtract one Vector from another More...
 
static void Sub (ref Vector3d a, ref Vector3d b, out Vector3d result)
 Subtract one Vector from another More...
 
static Vector3d Mult (Vector3d a, double f)
 Multiply a vector and a scalar More...
 
static void Mult (ref Vector3d a, double f, out Vector3d result)
 Multiply a vector and a scalar More...
 
static Vector3d Div (Vector3d a, double f)
 Divide a vector by a scalar More...
 
static void Div (ref Vector3d a, double f, out Vector3d result)
 Divide a vector by a scalar More...
 
static Vector3d Add (Vector3d a, Vector3d b)
 Adds two vectors. More...
 
static void Add (ref Vector3d a, ref Vector3d b, out Vector3d result)
 Adds two vectors. More...
 
static Vector3d Subtract (Vector3d a, Vector3d b)
 Subtract one Vector from another More...
 
static void Subtract (ref Vector3d a, ref Vector3d b, out Vector3d result)
 Subtract one Vector from another More...
 
static Vector3d Multiply (Vector3d vector, double scale)
 Multiplies a vector by a scalar. More...
 
static void Multiply (ref Vector3d vector, double scale, out Vector3d result)
 Multiplies a vector by a scalar. More...
 
static Vector3d Multiply (Vector3d vector, Vector3d scale)
 Multiplies a vector by the components a vector (scale). More...
 
static void Multiply (ref Vector3d vector, ref Vector3d scale, out Vector3d result)
 Multiplies a vector by the components of a vector (scale). More...
 
static Vector3d Divide (Vector3d vector, double scale)
 Divides a vector by a scalar. More...
 
static void Divide (ref Vector3d vector, double scale, out Vector3d result)
 Divides a vector by a scalar. More...
 
static Vector3d Divide (Vector3d vector, Vector3d scale)
 Divides a vector by the components of a vector (scale). More...
 
static void Divide (ref Vector3d vector, ref Vector3d scale, out Vector3d result)
 Divide a vector by the components of a vector (scale). More...
 
static Vector3d ComponentMin (Vector3d a, Vector3d b)
 Calculate the component-wise minimum of two vectors More...
 
static void ComponentMin (ref Vector3d a, ref Vector3d b, out Vector3d result)
 Calculate the component-wise minimum of two vectors More...
 
static Vector3d ComponentMax (Vector3d a, Vector3d b)
 Calculate the component-wise maximum of two vectors More...
 
static void ComponentMax (ref Vector3d a, ref Vector3d b, out Vector3d result)
 Calculate the component-wise maximum of two vectors More...
 
static Vector3d Min (Vector3d left, Vector3d right)
 Returns the Vector3d with the minimum magnitude More...
 
static Vector3d Max (Vector3d left, Vector3d right)
 Returns the Vector3d with the minimum magnitude More...
 
static Vector3d Clamp (Vector3d vec, Vector3d min, Vector3d max)
 Clamp a vector to the given minimum and maximum vectors More...
 
static void Clamp (ref Vector3d vec, ref Vector3d min, ref Vector3d max, out Vector3d result)
 Clamp a vector to the given minimum and maximum vectors More...
 
static Vector3d Normalize (Vector3d vec)
 Scale a vector to unit length More...
 
static void Normalize (ref Vector3d vec, out Vector3d result)
 Scale a vector to unit length More...
 
static Vector3d NormalizeFast (Vector3d vec)
 Scale a vector to approximately unit length More...
 
static void NormalizeFast (ref Vector3d vec, out Vector3d result)
 Scale a vector to approximately unit length More...
 
static double Dot (Vector3d left, Vector3d right)
 Calculate the dot (scalar) product of two vectors More...
 
static void Dot (ref Vector3d left, ref Vector3d right, out double result)
 Calculate the dot (scalar) product of two vectors More...
 
static Vector3d Cross (Vector3d left, Vector3d right)
 Caclulate the cross (vector) product of two vectors More...
 
static void Cross (ref Vector3d left, ref Vector3d right, out Vector3d result)
 Caclulate the cross (vector) product of two vectors More...
 
static Vector3d Lerp (Vector3d a, Vector3d b, double blend)
 Returns a new Vector that is the linear blend of the 2 given Vectors More...
 
static void Lerp (ref Vector3d a, ref Vector3d b, double blend, out Vector3d result)
 Returns a new Vector that is the linear blend of the 2 given Vectors More...
 
static Vector3d BaryCentric (Vector3d a, Vector3d b, Vector3d c, double u, double v)
 Interpolate 3 Vectors using Barycentric coordinates More...
 
static void BaryCentric (ref Vector3d a, ref Vector3d b, ref Vector3d c, double u, double v, out Vector3d result)
 Interpolate 3 Vectors using Barycentric coordinates More...
 
static Vector3d TransformVector (Vector3d vec, Matrix4d mat)
 Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored. More...
 
static void TransformVector (ref Vector3d vec, ref Matrix4d mat, out Vector3d result)
 Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored. More...
 
static Vector3d TransformNormal (Vector3d norm, Matrix4d mat)
 Transform a Normal by the given Matrix More...
 
static void TransformNormal (ref Vector3d norm, ref Matrix4d mat, out Vector3d result)
 Transform a Normal by the given Matrix More...
 
static Vector3d TransformNormalInverse (Vector3d norm, Matrix4d invMat)
 Transform a Normal by the (transpose of the) given Matrix More...
 
static void TransformNormalInverse (ref Vector3d norm, ref Matrix4d invMat, out Vector3d result)
 Transform a Normal by the (transpose of the) given Matrix More...
 
static Vector3d TransformPosition (Vector3d pos, Matrix4d mat)
 Transform a Position by the given Matrix More...
 
static void TransformPosition (ref Vector3d pos, ref Matrix4d mat, out Vector3d result)
 Transform a Position by the given Matrix More...
 
static Vector3d Transform (Vector3d vec, Matrix4d mat)
 Transform a Vector by the given Matrix More...
 
static void Transform (ref Vector3d vec, ref Matrix4d mat, out Vector3d result)
 Transform a Vector by the given Matrix More...
 
static Vector3d Transform (Vector3d vec, Quaterniond quat)
 Transforms a vector by a quaternion rotation. More...
 
static void Transform (ref Vector3d vec, ref Quaterniond quat, out Vector3d result)
 Transforms a vector by a quaternion rotation. More...
 
static Vector3d TransformPerspective (Vector3d vec, Matrix4d mat)
 Transform a Vector3d by the given Matrix, and project the resulting Vector4 back to a Vector3 More...
 
static void TransformPerspective (ref Vector3d vec, ref Matrix4d mat, out Vector3d result)
 Transform a Vector3d by the given Matrix, and project the resulting Vector4d back to a Vector3d More...
 
static double CalculateAngle (Vector3d first, Vector3d second)
 Calculates the angle (in radians) between two vectors. More...
 
static void CalculateAngle (ref Vector3d first, ref Vector3d second, out double result)
 Calculates the angle (in radians) between two vectors. More...
 
static Vector3d operator+ (Vector3d left, Vector3d right)
 Adds two instances. More...
 
static Vector3d operator- (Vector3d left, Vector3d right)
 Subtracts two instances. More...
 
static Vector3d operator- (Vector3d vec)
 Negates an instance. More...
 
static Vector3d operator* (Vector3d vec, double scale)
 Multiplies an instance by a scalar. More...
 
static Vector3d operator* (double scale, Vector3d vec)
 Multiplies an instance by a scalar. More...
 
static Vector3d operator* (Vector3d vec, Matrix4d mat)
 Multiplies an instance by a matrix. More...
 
static Vector3d operator* (Matrix4d mat, Vector3d vec)
 Multiplies an instance by a matrix. More...
 
static Vector3d operator/ (Vector3d vec, double scale)
 Divides an instance by a scalar. More...
 
static bool operator== (Vector3d left, Vector3d right)
 Compares two instances for equality. More...
 
static bool operator!= (Vector3d left, Vector3d right)
 Compares two instances for inequality. More...
 
static operator Vector3d (Vector3 v3)
 Converts OpenTK.Vector3 to OpenTK.Vector3d. More...
 
static operator Vector3 (Vector3d v3d)
 Converts OpenTK.Vector3d to OpenTK.Vector3. More...
 

Public Attributes

double X
 The X component of the Vector3. More...
 
double Y
 The Y component of the Vector3. More...
 
double Z
 The Z component of the Vector3. More...
 

Static Public Attributes

static readonly Vector3d UnitX = new Vector3d(1, 0, 0)
 Defines a unit-length Vector3d that points towards the X-axis. More...
 
static readonly Vector3d UnitY = new Vector3d(0, 1, 0)
 Defines a unit-length Vector3d that points towards the Y-axis. More...
 
static readonly Vector3d UnitZ = new Vector3d(0, 0, 1)
 /// Defines a unit-length Vector3d that points towards the Z-axis. More...
 
static readonly Vector3d Zero = new Vector3d(0, 0, 0)
 Defines a zero-length Vector3. More...
 
static readonly Vector3d One = new Vector3d(1, 1, 1)
 Defines an instance with all components set to 1. More...
 
static readonly int SizeInBytes = Marshal.SizeOf(new Vector3d())
 Defines the size of the Vector3d struct in bytes. More...
 

Properties

double this[int index] [get, set]
 Gets or sets the value at the index of the Vector. More...
 
double Length [get]
 Gets the length (magnitude) of the vector. More...
 
double LengthFast [get]
 Gets an approximation of the vector length (magnitude). More...
 
double LengthSquared [get]
 Gets the square of the vector length (magnitude). More...
 
Vector2d Xy [get, set]
 Gets or sets an OpenTK.Vector2d with the X and Y components of this instance. More...
 
Vector2d Xz [get, set]
 Gets or sets an OpenTK.Vector2d with the X and Z components of this instance. More...
 
Vector2d Yx [get, set]
 Gets or sets an OpenTK.Vector2d with the Y and X components of this instance. More...
 
Vector2d Yz [get, set]
 Gets or sets an OpenTK.Vector2d with the Y and Z components of this instance. More...
 
Vector2d Zx [get, set]
 Gets or sets an OpenTK.Vector2d with the Z and X components of this instance. More...
 
Vector2d Zy [get, set]
 Gets or sets an OpenTK.Vector2d with the Z and Y components of this instance. More...
 
Vector3d Xzy [get, set]
 Gets or sets an OpenTK.Vector3d with the X, Z, and Y components of this instance. More...
 
Vector3d Yxz [get, set]
 Gets or sets an OpenTK.Vector3d with the Y, X, and Z components of this instance. More...
 
Vector3d Yzx [get, set]
 Gets or sets an OpenTK.Vector3d with the Y, Z, and X components of this instance. More...
 
Vector3d Zxy [get, set]
 Gets or sets an OpenTK.Vector3d with the Z, X, and Y components of this instance. More...
 
Vector3d Zyx [get, set]
 Gets or sets an OpenTK.Vector3d with the Z, Y, and X components of this instance. More...
 

Detailed Description

Represents a 3D vector using three double-precision floating-point numbers.

Constructor & Destructor Documentation

OpenTK.Vector3d.Vector3d ( double  value)

Constructs a new instance.

Parameters
valueThe value that will initialize this instance.
OpenTK.Vector3d.Vector3d ( double  x,
double  y,
double  z 
)

Constructs a new Vector3.

Parameters
xThe x component of the Vector3.
yThe y component of the Vector3.
zThe z component of the Vector3.
OpenTK.Vector3d.Vector3d ( Vector2d  v)

Constructs a new instance from the given Vector2d.

Parameters
vThe Vector2d to copy components from.
OpenTK.Vector3d.Vector3d ( Vector3d  v)

Constructs a new instance from the given Vector3d.

Parameters
vThe Vector3d to copy components from.
OpenTK.Vector3d.Vector3d ( Vector4d  v)

Constructs a new instance from the given Vector4d.

Parameters
vThe Vector4d to copy components from.

Member Function Documentation

void OpenTK.Vector3d.Add ( Vector3d  right)

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.
void OpenTK.Vector3d.Add ( ref Vector3d  right)

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.
static Vector3d OpenTK.Vector3d.Add ( Vector3d  a,
Vector3d  b 
)
static

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
Returns
Result of operation.
static void OpenTK.Vector3d.Add ( ref Vector3d  a,
ref Vector3d  b,
out Vector3d  result 
)
static

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
resultResult of operation.
static Vector3d OpenTK.Vector3d.BaryCentric ( Vector3d  a,
Vector3d  b,
Vector3d  c,
double  u,
double  v 
)
static

Interpolate 3 Vectors using Barycentric coordinates

Parameters
aFirst input Vector
bSecond input Vector
cThird input Vector
uFirst Barycentric Coordinate
vSecond Barycentric Coordinate
Returns
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
static void OpenTK.Vector3d.BaryCentric ( ref Vector3d  a,
ref Vector3d  b,
ref Vector3d  c,
double  u,
double  v,
out Vector3d  result 
)
static

Interpolate 3 Vectors using Barycentric coordinates

Parameters
aFirst input Vector.
bSecond input Vector.
cThird input Vector.
uFirst Barycentric Coordinate.
vSecond Barycentric Coordinate.
resultOutput 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
static double OpenTK.Vector3d.CalculateAngle ( Vector3d  first,
Vector3d  second 
)
static

Calculates the angle (in radians) between two vectors.

Parameters
firstThe first vector.
secondThe second vector.
Returns
Angle (in radians) between the vectors.

Note that the returned angle is never bigger than the constant Pi.

static void OpenTK.Vector3d.CalculateAngle ( ref Vector3d  first,
ref Vector3d  second,
out double  result 
)
static

Calculates the angle (in radians) between two vectors.

Parameters
firstThe first vector.
secondThe second vector.
resultAngle (in radians) between the vectors.

Note that the returned angle is never bigger than the constant Pi.

static Vector3d OpenTK.Vector3d.Clamp ( Vector3d  vec,
Vector3d  min,
Vector3d  max 
)
static

Clamp a vector to the given minimum and maximum vectors

Parameters
vecInput vector
minMinimum vector
maxMaximum vector
Returns
The clamped vector
static void OpenTK.Vector3d.Clamp ( ref Vector3d  vec,
ref Vector3d  min,
ref Vector3d  max,
out Vector3d  result 
)
static

Clamp a vector to the given minimum and maximum vectors

Parameters
vecInput vector
minMinimum vector
maxMaximum vector
resultThe clamped vector
static Vector3d OpenTK.Vector3d.ComponentMax ( Vector3d  a,
Vector3d  b 
)
static

Calculate the component-wise maximum of two vectors

Parameters
aFirst operand
bSecond operand
Returns
The component-wise maximum
static void OpenTK.Vector3d.ComponentMax ( ref Vector3d  a,
ref Vector3d  b,
out Vector3d  result 
)
static

Calculate the component-wise maximum of two vectors

Parameters
aFirst operand
bSecond operand
resultThe component-wise maximum
static Vector3d OpenTK.Vector3d.ComponentMin ( Vector3d  a,
Vector3d  b 
)
static

Calculate the component-wise minimum of two vectors

Parameters
aFirst operand
bSecond operand
Returns
The component-wise minimum
static void OpenTK.Vector3d.ComponentMin ( ref Vector3d  a,
ref Vector3d  b,
out Vector3d  result 
)
static

Calculate the component-wise minimum of two vectors

Parameters
aFirst operand
bSecond operand
resultThe component-wise minimum
static Vector3d OpenTK.Vector3d.Cross ( Vector3d  left,
Vector3d  right 
)
static

Caclulate the cross (vector) product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The cross product of the two inputs
static void OpenTK.Vector3d.Cross ( ref Vector3d  left,
ref Vector3d  right,
out Vector3d  result 
)
static

Caclulate the cross (vector) product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The cross product of the two inputs
Parameters
resultThe cross product of the two inputs
void OpenTK.Vector3d.Div ( double  f)

Divide this instance by a scalar.

Parameters
fScalar operand.
static Vector3d OpenTK.Vector3d.Div ( Vector3d  a,
double  f 
)
static

Divide a vector by a scalar

Parameters
aVector operand
fScalar operand
Returns
Result of the division
static void OpenTK.Vector3d.Div ( ref Vector3d  a,
double  f,
out Vector3d  result 
)
static

Divide a vector by a scalar

Parameters
aVector operand
fScalar operand
resultResult of the division
static Vector3d OpenTK.Vector3d.Divide ( Vector3d  vector,
double  scale 
)
static

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.
static void OpenTK.Vector3d.Divide ( ref Vector3d  vector,
double  scale,
out Vector3d  result 
)
static

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.
static Vector3d OpenTK.Vector3d.Divide ( Vector3d  vector,
Vector3d  scale 
)
static

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

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.
static void OpenTK.Vector3d.Divide ( ref Vector3d  vector,
ref Vector3d  scale,
out Vector3d  result 
)
static

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

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.
static double OpenTK.Vector3d.Dot ( Vector3d  left,
Vector3d  right 
)
static

Calculate the dot (scalar) product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The dot product of the two inputs
static void OpenTK.Vector3d.Dot ( ref Vector3d  left,
ref Vector3d  right,
out double  result 
)
static

Calculate the dot (scalar) product of two vectors

Parameters
leftFirst operand
rightSecond operand
resultThe dot product of the two inputs
override bool OpenTK.Vector3d.Equals ( object  obj)

Indicates whether this instance and a specified object are equal.

Parameters
objThe object to compare to.
Returns
True if the instances are equal; false otherwise.
bool OpenTK.Vector3d.Equals ( Vector3d  other)

Indicates whether the current vector is equal to another vector.

Parameters
otherA vector to compare with this vector.
Returns
true if the current vector is equal to the vector parameter; otherwise, false.
override int OpenTK.Vector3d.GetHashCode ( )

Returns the hashcode for this instance.

Returns
A System.Int32 containing the unique hashcode for this instance.
static Vector3d OpenTK.Vector3d.Lerp ( Vector3d  a,
Vector3d  b,
double  blend 
)
static

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

Parameters
aFirst input vector
bSecond input vector
blendThe blend factor. a when blend=0, b when blend=1.
Returns
a when blend=0, b when blend=1, and a linear combination otherwise
static void OpenTK.Vector3d.Lerp ( ref Vector3d  a,
ref Vector3d  b,
double  blend,
out Vector3d  result 
)
static

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

Parameters
aFirst input vector
bSecond input vector
blendThe blend factor. a when blend=0, b when blend=1.
resulta when blend=0, b when blend=1, and a linear combination otherwise
static Vector3d OpenTK.Vector3d.Max ( Vector3d  left,
Vector3d  right 
)
static

Returns the Vector3d with the minimum magnitude

Parameters
leftLeft operand
rightRight operand
Returns
The minimum Vector3
static Vector3d OpenTK.Vector3d.Min ( Vector3d  left,
Vector3d  right 
)
static

Returns the Vector3d with the minimum magnitude

Parameters
leftLeft operand
rightRight operand
Returns
The minimum Vector3
void OpenTK.Vector3d.Mult ( double  f)

Multiply this instance by a scalar.

Parameters
fScalar operand.
static Vector3d OpenTK.Vector3d.Mult ( Vector3d  a,
double  f 
)
static

Multiply a vector and a scalar

Parameters
aVector operand
fScalar operand
Returns
Result of the multiplication
static void OpenTK.Vector3d.Mult ( ref Vector3d  a,
double  f,
out Vector3d  result 
)
static

Multiply a vector and a scalar

Parameters
aVector operand
fScalar operand
resultResult of the multiplication
static Vector3d OpenTK.Vector3d.Multiply ( Vector3d  vector,
double  scale 
)
static

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.
static void OpenTK.Vector3d.Multiply ( ref Vector3d  vector,
double  scale,
out Vector3d  result 
)
static

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.
static Vector3d OpenTK.Vector3d.Multiply ( Vector3d  vector,
Vector3d  scale 
)
static

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

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.
static void OpenTK.Vector3d.Multiply ( ref Vector3d  vector,
ref Vector3d  scale,
out Vector3d  result 
)
static

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

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.
void OpenTK.Vector3d.Normalize ( )

Scales the Vector3d to unit length.

static Vector3d OpenTK.Vector3d.Normalize ( Vector3d  vec)
static

Scale a vector to unit length

Parameters
vecThe input vector
Returns
The normalized vector
static void OpenTK.Vector3d.Normalize ( ref Vector3d  vec,
out Vector3d  result 
)
static

Scale a vector to unit length

Parameters
vecThe input vector
resultThe normalized vector
Vector3d OpenTK.Vector3d.Normalized ( )

Returns a copy of the Vector3d scaled to unit length.

Returns
void OpenTK.Vector3d.NormalizeFast ( )

Scales the Vector3d to approximately unit length.

static Vector3d OpenTK.Vector3d.NormalizeFast ( Vector3d  vec)
static

Scale a vector to approximately unit length

Parameters
vecThe input vector
Returns
The normalized vector
static void OpenTK.Vector3d.NormalizeFast ( ref Vector3d  vec,
out Vector3d  result 
)
static

Scale a vector to approximately unit length

Parameters
vecThe input vector
resultThe normalized vector
static OpenTK.Vector3d.operator Vector3 ( Vector3d  v3d)
explicitstatic

Converts OpenTK.Vector3d to OpenTK.Vector3.

Parameters
v3dThe Vector3d to convert.
Returns
The resulting Vector3.
static OpenTK.Vector3d.operator Vector3d ( Vector3  v3)
explicitstatic

Converts OpenTK.Vector3 to OpenTK.Vector3d.

Parameters
v3The Vector3 to convert.
Returns
The resulting Vector3d.
static bool OpenTK.Vector3d.operator!= ( Vector3d  left,
Vector3d  right 
)
static

Compares two instances for inequality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left does not equa lright; false otherwise.
static Vector3d OpenTK.Vector3d.operator* ( Vector3d  vec,
double  scale 
)
static

Multiplies an instance by a scalar.

Parameters
vecThe instance.
scaleThe scalar.
Returns
The result of the calculation.
static Vector3d OpenTK.Vector3d.operator* ( double  scale,
Vector3d  vec 
)
static

Multiplies an instance by a scalar.

Parameters
scaleThe scalar.
vecThe instance.
Returns
The result of the calculation.
static Vector3d OpenTK.Vector3d.operator* ( Vector3d  vec,
Matrix4d  mat 
)
static

Multiplies an instance by a matrix.

Parameters
scaleThe scalar.
vecThe matrix.
Returns
The result of the calculation.
static Vector3d OpenTK.Vector3d.operator* ( Matrix4d  mat,
Vector3d  vec 
)
static

Multiplies an instance by a matrix.

Parameters
vecThe matrix.
scaleThe scalar.
Returns
The result of the calculation.
static Vector3d OpenTK.Vector3d.operator+ ( Vector3d  left,
Vector3d  right 
)
static

Adds two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.
static Vector3d OpenTK.Vector3d.operator- ( Vector3d  left,
Vector3d  right 
)
static

Subtracts two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.
static Vector3d OpenTK.Vector3d.operator- ( Vector3d  vec)
static

Negates an instance.

Parameters
vecThe instance.
Returns
The result of the calculation.
static Vector3d OpenTK.Vector3d.operator/ ( Vector3d  vec,
double  scale 
)
static

Divides an instance by a scalar.

Parameters
vecThe instance.
scaleThe scalar.
Returns
The result of the calculation.
static bool OpenTK.Vector3d.operator== ( Vector3d  left,
Vector3d  right 
)
static

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.
void OpenTK.Vector3d.Scale ( double  sx,
double  sy,
double  sz 
)

Scales the current Vector3d by the given amounts.

Parameters
sxThe scale of the X component.
syThe scale of the Y component.
szThe scale of the Z component.
void OpenTK.Vector3d.Scale ( Vector3d  scale)

Scales this instance by the given parameter.

Parameters
scaleThe scaling of the individual components.
void OpenTK.Vector3d.Scale ( ref Vector3d  scale)

Scales this instance by the given parameter.

Parameters
scaleThe scaling of the individual components.
void OpenTK.Vector3d.Sub ( Vector3d  right)

Subtract the Vector passed as parameter from this instance.

Parameters
rightRight operand. This parameter is only read from.
void OpenTK.Vector3d.Sub ( ref Vector3d  right)

Subtract the Vector passed as parameter from this instance.

Parameters
rightRight operand. This parameter is only read from.
static Vector3d OpenTK.Vector3d.Sub ( Vector3d  a,
Vector3d  b 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction
static void OpenTK.Vector3d.Sub ( ref Vector3d  a,
ref Vector3d  b,
out Vector3d  result 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction
static Vector3d OpenTK.Vector3d.Subtract ( Vector3d  a,
Vector3d  b 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction
static void OpenTK.Vector3d.Subtract ( ref Vector3d  a,
ref Vector3d  b,
out Vector3d  result 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction
override string OpenTK.Vector3d.ToString ( )

Returns a System.String that represents the current Vector3.

Returns
static Vector3d OpenTK.Vector3d.Transform ( Vector3d  vec,
Matrix4d  mat 
)
static

Transform a Vector by the given Matrix

Parameters
vecThe vector to transform
matThe desired transformation
Returns
The transformed vector
static void OpenTK.Vector3d.Transform ( ref Vector3d  vec,
ref Matrix4d  mat,
out Vector3d  result 
)
static

Transform a Vector by the given Matrix

Parameters
vecThe vector to transform
matThe desired transformation
resultThe transformed vector
static Vector3d OpenTK.Vector3d.Transform ( Vector3d  vec,
Quaterniond  quat 
)
static

Transforms a vector by a quaternion rotation.

Parameters
vecThe vector to transform.
quatThe quaternion to rotate the vector by.
Returns
The result of the operation.
static void OpenTK.Vector3d.Transform ( ref Vector3d  vec,
ref Quaterniond  quat,
out Vector3d  result 
)
static

Transforms a vector by a quaternion rotation.

Parameters
vecThe vector to transform.
quatThe quaternion to rotate the vector by.
resultThe result of the operation.
static Vector3d OpenTK.Vector3d.TransformNormal ( Vector3d  norm,
Matrix4d  mat 
)
static

Transform a Normal by the given Matrix

This calculates the inverse of the given matrix, use TransformNormalInverse if you already have the inverse to avoid this extra calculation

Parameters
normThe normal to transform
matThe desired transformation
Returns
The transformed normal
static void OpenTK.Vector3d.TransformNormal ( ref Vector3d  norm,
ref Matrix4d  mat,
out Vector3d  result 
)
static

Transform a Normal by the given Matrix

This calculates the inverse of the given matrix, use TransformNormalInverse if you already have the inverse to avoid this extra calculation

Parameters
normThe normal to transform
matThe desired transformation
resultThe transformed normal
static Vector3d OpenTK.Vector3d.TransformNormalInverse ( Vector3d  norm,
Matrix4d  invMat 
)
static

Transform a Normal by the (transpose of the) given Matrix

This version doesn't calculate the inverse matrix. Use this version if you already have the inverse of the desired transform to hand

Parameters
normThe normal to transform
invMatThe inverse of the desired transformation
Returns
The transformed normal
static void OpenTK.Vector3d.TransformNormalInverse ( ref Vector3d  norm,
ref Matrix4d  invMat,
out Vector3d  result 
)
static

Transform a Normal by the (transpose of the) given Matrix

This version doesn't calculate the inverse matrix. Use this version if you already have the inverse of the desired transform to hand

Parameters
normThe normal to transform
invMatThe inverse of the desired transformation
resultThe transformed normal
static Vector3d OpenTK.Vector3d.TransformPerspective ( Vector3d  vec,
Matrix4d  mat 
)
static

Transform a Vector3d by the given Matrix, and project the resulting Vector4 back to a Vector3

Parameters
vecThe vector to transform
matThe desired transformation
Returns
The transformed vector
static void OpenTK.Vector3d.TransformPerspective ( ref Vector3d  vec,
ref Matrix4d  mat,
out Vector3d  result 
)
static

Transform a Vector3d by the given Matrix, and project the resulting Vector4d back to a Vector3d

Parameters
vecThe vector to transform
matThe desired transformation
resultThe transformed vector
static Vector3d OpenTK.Vector3d.TransformPosition ( Vector3d  pos,
Matrix4d  mat 
)
static

Transform a Position by the given Matrix

Parameters
posThe position to transform
matThe desired transformation
Returns
The transformed position
static void OpenTK.Vector3d.TransformPosition ( ref Vector3d  pos,
ref Matrix4d  mat,
out Vector3d  result 
)
static

Transform a Position by the given Matrix

Parameters
posThe position to transform
matThe desired transformation
resultThe transformed position
static Vector3d OpenTK.Vector3d.TransformVector ( Vector3d  vec,
Matrix4d  mat 
)
static

Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored.

Parameters
vecThe vector to transform
matThe desired transformation
Returns
The transformed vector
static void OpenTK.Vector3d.TransformVector ( ref Vector3d  vec,
ref Matrix4d  mat,
out Vector3d  result 
)
static

Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored.

Parameters
vecThe vector to transform
matThe desired transformation
resultThe transformed vector

Member Data Documentation

readonly Vector3d OpenTK.Vector3d.One = new Vector3d(1, 1, 1)
static

Defines an instance with all components set to 1.

readonly int OpenTK.Vector3d.SizeInBytes = Marshal.SizeOf(new Vector3d())
static

Defines the size of the Vector3d struct in bytes.

readonly Vector3d OpenTK.Vector3d.UnitX = new Vector3d(1, 0, 0)
static

Defines a unit-length Vector3d that points towards the X-axis.

readonly Vector3d OpenTK.Vector3d.UnitY = new Vector3d(0, 1, 0)
static

Defines a unit-length Vector3d that points towards the Y-axis.

readonly Vector3d OpenTK.Vector3d.UnitZ = new Vector3d(0, 0, 1)
static

/// Defines a unit-length Vector3d that points towards the Z-axis.

double OpenTK.Vector3d.X

The X component of the Vector3.

double OpenTK.Vector3d.Y

The Y component of the Vector3.

double OpenTK.Vector3d.Z

The Z component of the Vector3.

readonly Vector3d OpenTK.Vector3d.Zero = new Vector3d(0, 0, 0)
static

Defines a zero-length Vector3.

Property Documentation

double OpenTK.Vector3d.Length
get

Gets the length (magnitude) of the vector.

LengthFast

See Also
LengthSquared
double OpenTK.Vector3d.LengthFast
get

Gets an approximation of the vector length (magnitude).

This property uses an approximation of the square root function to calculate vector magnitude, with an upper error bound of 0.001.

Length

See Also
LengthSquared
double OpenTK.Vector3d.LengthSquared
get

Gets the square of the vector length (magnitude).

This property avoids the costly square root operation required by the Length property. This makes it more suitable for comparisons.

Length

See Also
LengthFast
double OpenTK.Vector3d.this[int index]
getset

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

Vector2d OpenTK.Vector3d.Xy
getset

Gets or sets an OpenTK.Vector2d with the X and Y components of this instance.

Vector2d OpenTK.Vector3d.Xz
getset

Gets or sets an OpenTK.Vector2d with the X and Z components of this instance.

Vector3d OpenTK.Vector3d.Xzy
getset

Gets or sets an OpenTK.Vector3d with the X, Z, and Y components of this instance.

Vector2d OpenTK.Vector3d.Yx
getset

Gets or sets an OpenTK.Vector2d with the Y and X components of this instance.

Vector3d OpenTK.Vector3d.Yxz
getset

Gets or sets an OpenTK.Vector3d with the Y, X, and Z components of this instance.

Vector2d OpenTK.Vector3d.Yz
getset

Gets or sets an OpenTK.Vector2d with the Y and Z components of this instance.

Vector3d OpenTK.Vector3d.Yzx
getset

Gets or sets an OpenTK.Vector3d with the Y, Z, and X components of this instance.

Vector2d OpenTK.Vector3d.Zx
getset

Gets or sets an OpenTK.Vector2d with the Z and X components of this instance.

Vector3d OpenTK.Vector3d.Zxy
getset

Gets or sets an OpenTK.Vector3d with the Z, X, and Y components of this instance.

Vector2d OpenTK.Vector3d.Zy
getset

Gets or sets an OpenTK.Vector2d with the Z and Y components of this instance.

Vector3d OpenTK.Vector3d.Zyx
getset

Gets or sets an OpenTK.Vector3d with the Z, Y, and X components of this instance.