OpenTK.Vector2d Struct Reference

Represents a 2D vector using two double-precision floating-point numbers. More...

List of all members.

Public Member Functions

 Vector2d (double x, double y)
 Constructs left vector with the given coordinates.
void Add (Vector2d right)
 Add the Vector passed as parameter to this instance.
void Add (ref Vector2d right)
 Add the Vector passed as parameter to this instance.
void Sub (Vector2d right)
 Subtract the Vector passed as parameter from this instance.
void Sub (ref Vector2d right)
 Subtract the Vector passed as parameter from this instance.
void Mult (double f)
 Multiply this instance by a scalar.
void Div (double f)
 Divide this instance by a scalar.
void Normalize ()
 Scales the Vector2 to unit length.
void Scale (double sx, double sy)
 Scales the current Vector2 by the given amounts.
void Scale (Vector2d scale)
 Scales this instance by the given parameter.
void Scale (ref Vector2d scale)
 Scales this instance by the given parameter.
override string ToString ()
 Returns a System.String that represents the current instance.
override int GetHashCode ()
 Returns the hashcode for this instance.
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal.
bool Equals (Vector2d other)
 Indicates whether the current vector is equal to another vector.

Static Public Member Functions

static Vector2d Sub (Vector2d a, Vector2d b)
 Subtract one Vector from another.
static void Sub (ref Vector2d a, ref Vector2d b, out Vector2d result)
 Subtract one Vector from another.
static Vector2d Mult (Vector2d a, double d)
 Multiply a vector and a scalar.
static void Mult (ref Vector2d a, double d, out Vector2d result)
 Multiply a vector and a scalar.
static Vector2d Div (Vector2d a, double d)
 Divide a vector by a scalar.
static void Div (ref Vector2d a, double d, out Vector2d result)
 Divide a vector by a scalar.
static Vector2d Add (Vector2d a, Vector2d b)
 Adds two vectors.
static void Add (ref Vector2d a, ref Vector2d b, out Vector2d result)
 Adds two vectors.
static Vector2d Subtract (Vector2d a, Vector2d b)
 Subtract one Vector from another.
static void Subtract (ref Vector2d a, ref Vector2d b, out Vector2d result)
 Subtract one Vector from another.
static Vector2d Multiply (Vector2d vector, double scale)
 Multiplies a vector by a scalar.
static void Multiply (ref Vector2d vector, double scale, out Vector2d result)
 Multiplies a vector by a scalar.
static Vector2d Multiply (Vector2d vector, Vector2d scale)
 Multiplies a vector by the components a vector (scale).
static void Multiply (ref Vector2d vector, ref Vector2d scale, out Vector2d result)
 Multiplies a vector by the components of a vector (scale).
static Vector2d Divide (Vector2d vector, double scale)
 Divides a vector by a scalar.
static void Divide (ref Vector2d vector, double scale, out Vector2d result)
 Divides a vector by a scalar.
static Vector2d Divide (Vector2d vector, Vector2d scale)
 Divides a vector by the components of a vector (scale).
static void Divide (ref Vector2d vector, ref Vector2d scale, out Vector2d result)
 Divide a vector by the components of a vector (scale).
static Vector2d Min (Vector2d a, Vector2d b)
 Calculate the component-wise minimum of two vectors.
static void Min (ref Vector2d a, ref Vector2d b, out Vector2d result)
 Calculate the component-wise minimum of two vectors.
static Vector2d Max (Vector2d a, Vector2d b)
 Calculate the component-wise maximum of two vectors.
static void Max (ref Vector2d a, ref Vector2d b, out Vector2d result)
 Calculate the component-wise maximum of two vectors.
static Vector2d Clamp (Vector2d vec, Vector2d min, Vector2d max)
 Clamp a vector to the given minimum and maximum vectors.
static void Clamp (ref Vector2d vec, ref Vector2d min, ref Vector2d max, out Vector2d result)
 Clamp a vector to the given minimum and maximum vectors.
static Vector2d Normalize (Vector2d vec)
 Scale a vector to unit length.
static void Normalize (ref Vector2d vec, out Vector2d result)
 Scale a vector to unit length.
static Vector2d NormalizeFast (Vector2d vec)
 Scale a vector to approximately unit length.
static void NormalizeFast (ref Vector2d vec, out Vector2d result)
 Scale a vector to approximately unit length.
static double Dot (Vector2d left, Vector2d right)
 Calculate the dot (scalar) product of two vectors.
static void Dot (ref Vector2d left, ref Vector2d right, out double result)
 Calculate the dot (scalar) product of two vectors.
static Vector2d Lerp (Vector2d a, Vector2d b, double blend)
 Returns a new Vector that is the linear blend of the 2 given Vectors.
static void Lerp (ref Vector2d a, ref Vector2d b, double blend, out Vector2d result)
 Returns a new Vector that is the linear blend of the 2 given Vectors.
static Vector2d BaryCentric (Vector2d a, Vector2d b, Vector2d c, double u, double v)
 Interpolate 3 Vectors using Barycentric coordinates.
static void BaryCentric (ref Vector2d a, ref Vector2d b, ref Vector2d c, double u, double v, out Vector2d result)
 Interpolate 3 Vectors using Barycentric coordinates.
static Vector2d Transform (Vector2d vec, Quaterniond quat)
 Transforms a vector by a quaternion rotation.
static void Transform (ref Vector2d vec, ref Quaterniond quat, out Vector2d result)
 Transforms a vector by a quaternion rotation.
static Vector2d operator+ (Vector2d left, Vector2d right)
 Adds two instances.
static Vector2d operator- (Vector2d left, Vector2d right)
 Subtracts two instances.
static Vector2d operator- (Vector2d vec)
 Negates an instance.
static Vector2d operator* (Vector2d vec, double f)
 Multiplies an instance by a scalar.
static Vector2d operator* (double f, Vector2d vec)
 Multiply an instance by a scalar.
static Vector2d operator/ (Vector2d vec, double f)
 Divides an instance by a scalar.
static bool operator== (Vector2d left, Vector2d right)
 Compares two instances for equality.
static bool operator!= (Vector2d left, Vector2d right)
 Compares two instances for ienquality.
static operator Vector2d (Vector2 v2)
 Converts OpenTK.Vector2 to OpenTK.Vector2d.
static operator Vector2 (Vector2d v2d)
 Converts OpenTK.Vector2d to OpenTK.Vector2.

Public Attributes

double X
 The X coordinate of this instance.
double Y
 The Y coordinate of this instance.

Static Public Attributes

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

Properties

double Length [get]
 Gets the length (magnitude) of the vector.
double LengthSquared [get]
 Gets the square of the vector length (magnitude).
Vector2d PerpendicularRight [get]
 Gets the perpendicular vector on the right side of this vector.
Vector2d PerpendicularLeft [get]
 Gets the perpendicular vector on the left side of this vector.

Detailed Description

Represents a 2D vector using two double-precision floating-point numbers.

Definition at line 33 of file Vector2d.cs.


Constructor & Destructor Documentation

OpenTK.Vector2d.Vector2d ( double  x,
double  y 
)

Constructs left vector with the given coordinates.

Parameters:
x The X coordinate.
y The Y coordinate.

Definition at line 75 of file Vector2d.cs.

00076         {
00077             this.X = x;
00078             this.Y = y;
00079         }


Member Function Documentation

static void OpenTK.Vector2d.Add ( ref Vector2d  a,
ref Vector2d  b,
out Vector2d  result 
) [static]

Adds two vectors.

Parameters:
a Left operand.
b Right operand.
result Result of operation.

Definition at line 398 of file Vector2d.cs.

00399         {
00400             result = new Vector2d(a.X + b.X, a.Y + b.Y);
00401         }

static Vector2d OpenTK.Vector2d.Add ( Vector2d  a,
Vector2d  b 
) [static]

Adds two vectors.

Parameters:
a Left operand.
b Right operand.
Returns:
Result of operation.

Definition at line 386 of file Vector2d.cs.

00387         {
00388             Add(ref a, ref b, out a);
00389             return a;
00390         }

void OpenTK.Vector2d.Add ( ref Vector2d  right  ) 

Add the Vector passed as parameter to this instance.

Parameters:
right Right operand. This parameter is only read from.

Definition at line 102 of file Vector2d.cs.

00103         {
00104             this.X += right.X;
00105             this.Y += right.Y;
00106         }

void OpenTK.Vector2d.Add ( Vector2d  right  ) 

Add the Vector passed as parameter to this instance.

Parameters:
right Right operand. This parameter is only read from.

Definition at line 92 of file Vector2d.cs.

00093         {
00094             this.X += right.X;
00095             this.Y += right.Y;
00096         }

static void OpenTK.Vector2d.BaryCentric ( ref Vector2d  a,
ref Vector2d  b,
ref Vector2d  c,
double  u,
double  v,
out Vector2d  result 
) [static]

Interpolate 3 Vectors using Barycentric coordinates.

Parameters:
a First input Vector.
b Second input Vector.
c Third input Vector.
u First Barycentric Coordinate.
v Second Barycentric Coordinate.
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

Definition at line 759 of file Vector2d.cs.

00760         {
00761             result = a; // copy
00762 
00763             Vector2d temp = b; // copy
00764             Subtract(ref temp, ref a, out temp);
00765             Multiply(ref temp, u, out temp);
00766             Add(ref result, ref temp, out result);
00767 
00768             temp = c; // copy
00769             Subtract(ref temp, ref a, out temp);
00770             Multiply(ref temp, v, out temp);
00771             Add(ref result, ref temp, out result);
00772         }

static Vector2d OpenTK.Vector2d.BaryCentric ( Vector2d  a,
Vector2d  b,
Vector2d  c,
double  u,
double  v 
) [static]

Interpolate 3 Vectors using Barycentric coordinates.

Parameters:
a First input Vector
b Second input Vector
c Third input Vector
u First Barycentric Coordinate
v Second 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

Definition at line 747 of file Vector2d.cs.

00748         {
00749             return a + u * (b - a) + v * (c - a);
00750         }

static void OpenTK.Vector2d.Clamp ( ref Vector2d  vec,
ref Vector2d  min,
ref Vector2d  max,
out Vector2d  result 
) [static]

Clamp a vector to the given minimum and maximum vectors.

Parameters:
vec Input vector
min Minimum vector
max Maximum vector
result The clamped vector

Definition at line 613 of file Vector2d.cs.

00614         {
00615             result.X = vec.X < min.X ? min.X : vec.X > max.X ? max.X : vec.X;
00616             result.Y = vec.Y < min.Y ? min.Y : vec.Y > max.Y ? max.Y : vec.Y;
00617         }

static Vector2d OpenTK.Vector2d.Clamp ( Vector2d  vec,
Vector2d  min,
Vector2d  max 
) [static]

Clamp a vector to the given minimum and maximum vectors.

Parameters:
vec Input vector
min Minimum vector
max Maximum vector
Returns:
The clamped vector

Definition at line 599 of file Vector2d.cs.

00600         {
00601             vec.X = vec.X < min.X ? min.X : vec.X > max.X ? max.X : vec.X;
00602             vec.Y = vec.Y < min.Y ? min.Y : vec.Y > max.Y ? max.Y : vec.Y;
00603             return vec;
00604         }

static void OpenTK.Vector2d.Div ( ref Vector2d  a,
double  d,
out Vector2d  result 
) [static]

Divide a vector by a scalar.

Parameters:
a Vector operand
d Scalar operand
result Result of the division

Definition at line 367 of file Vector2d.cs.

00368         {
00369             double mult = 1.0 / d;
00370             result.X = a.X * mult;
00371             result.Y = a.Y * mult;
00372         }

static Vector2d OpenTK.Vector2d.Div ( Vector2d  a,
double  d 
) [static]

Divide a vector by a scalar.

Parameters:
a Vector operand
d Scalar operand
Returns:
Result of the division

Definition at line 352 of file Vector2d.cs.

00353         {
00354             double mult = 1.0 / d;
00355             a.X *= mult;
00356             a.Y *= mult;
00357             return a;
00358         }

void OpenTK.Vector2d.Div ( double  f  ) 

Divide this instance by a scalar.

Parameters:
f Scalar operand.

Definition at line 151 of file Vector2d.cs.

00152         {
00153             double mult = 1.0 / f;
00154             this.X *= mult;
00155             this.Y *= mult;
00156         }

static void OpenTK.Vector2d.Divide ( ref Vector2d  vector,
ref Vector2d  scale,
out Vector2d  result 
) [static]

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

Parameters:
vector Left operand.
scale Right operand.
result Result of the operation.

Definition at line 525 of file Vector2d.cs.

00526         {
00527             result = new Vector2d(vector.X / scale.X, vector.Y / scale.Y);
00528         }

static Vector2d OpenTK.Vector2d.Divide ( Vector2d  vector,
Vector2d  scale 
) [static]

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

Parameters:
vector Left operand.
scale Right operand.
Returns:
Result of the operation.

Definition at line 513 of file Vector2d.cs.

00514         {
00515             Divide(ref vector, ref scale, out vector);
00516             return vector;
00517         }

static void OpenTK.Vector2d.Divide ( ref Vector2d  vector,
double  scale,
out Vector2d  result 
) [static]

Divides a vector by a scalar.

Parameters:
vector Left operand.
scale Right operand.
result Result of the operation.

Definition at line 502 of file Vector2d.cs.

00503         {
00504             Multiply(ref vector, 1 / scale, out result);
00505         }

static Vector2d OpenTK.Vector2d.Divide ( Vector2d  vector,
double  scale 
) [static]

Divides a vector by a scalar.

Parameters:
vector Left operand.
scale Right operand.
Returns:
Result of the operation.

Definition at line 490 of file Vector2d.cs.

00491         {
00492             Divide(ref vector, scale, out vector);
00493             return vector;
00494         }

static void OpenTK.Vector2d.Dot ( ref Vector2d  left,
ref Vector2d  right,
out double  result 
) [static]

Calculate the dot (scalar) product of two vectors.

Parameters:
left First operand
right Second operand
result The dot product of the two inputs

Definition at line 698 of file Vector2d.cs.

00699         {
00700             result = left.X * right.X + left.Y * right.Y;
00701         }

static double OpenTK.Vector2d.Dot ( Vector2d  left,
Vector2d  right 
) [static]

Calculate the dot (scalar) product of two vectors.

Parameters:
left First operand
right Second operand
Returns:
The dot product of the two inputs

Definition at line 687 of file Vector2d.cs.

00688         {
00689             return left.X * right.X + left.Y * right.Y;
00690         }

bool OpenTK.Vector2d.Equals ( Vector2d  other  ) 

Indicates whether the current vector is equal to another vector.

Parameters:
other A vector to compare with this vector.
Returns:
true if the current vector is equal to the vector parameter; otherwise, false.

Definition at line 985 of file Vector2d.cs.

00986         {
00987             return
00988                 X == other.X &&
00989                 Y == other.Y;
00990         }

override bool OpenTK.Vector2d.Equals ( object  obj  ) 

Indicates whether this instance and a specified object are equal.

Parameters:
obj The object to compare to.
Returns:
True if the instances are equal; false otherwise.

Definition at line 966 of file Vector2d.cs.

00967         {
00968             if (!(obj is Vector2d))
00969                 return false;
00970 
00971             return this.Equals((Vector2d)obj);
00972         }

override int OpenTK.Vector2d.GetHashCode (  ) 

Returns the hashcode for this instance.

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

Definition at line 952 of file Vector2d.cs.

00953         {
00954             return X.GetHashCode() ^ Y.GetHashCode();
00955         }

static void OpenTK.Vector2d.Lerp ( ref Vector2d  a,
ref Vector2d  b,
double  blend,
out Vector2d  result 
) [static]

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

Parameters:
a First input vector
b Second input vector
blend The blend factor. a when blend=0, b when blend=1.
result a when blend=0, b when blend=1, and a linear combination otherwise

Definition at line 728 of file Vector2d.cs.

00729         {
00730             result.X = blend * (b.X - a.X) + a.X;
00731             result.Y = blend * (b.Y - a.Y) + a.Y;
00732         }

static Vector2d OpenTK.Vector2d.Lerp ( Vector2d  a,
Vector2d  b,
double  blend 
) [static]

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

Parameters:
a First input vector
b Second input vector
blend The blend factor. a when blend=0, b when blend=1.
Returns:
a when blend=0, b when blend=1, and a linear combination otherwise

Definition at line 714 of file Vector2d.cs.

00715         {
00716             a.X = blend * (b.X - a.X) + a.X;
00717             a.Y = blend * (b.Y - a.Y) + a.Y;
00718             return a;
00719         }

static void OpenTK.Vector2d.Max ( ref Vector2d  a,
ref Vector2d  b,
out Vector2d  result 
) [static]

Calculate the component-wise maximum of two vectors.

Parameters:
a First operand
b Second operand
result The component-wise maximum

Definition at line 582 of file Vector2d.cs.

00583         {
00584             result.X = a.X > b.X ? a.X : b.X;
00585             result.Y = a.Y > b.Y ? a.Y : b.Y;
00586         }

static Vector2d OpenTK.Vector2d.Max ( Vector2d  a,
Vector2d  b 
) [static]

Calculate the component-wise maximum of two vectors.

Parameters:
a First operand
b Second operand
Returns:
The component-wise maximum

Definition at line 569 of file Vector2d.cs.

00570         {
00571             a.X = a.X > b.X ? a.X : b.X;
00572             a.Y = a.Y > b.Y ? a.Y : b.Y;
00573             return a;
00574         }

static void OpenTK.Vector2d.Min ( ref Vector2d  a,
ref Vector2d  b,
out Vector2d  result 
) [static]

Calculate the component-wise minimum of two vectors.

Parameters:
a First operand
b Second operand
result The component-wise minimum

Definition at line 553 of file Vector2d.cs.

00554         {
00555             result.X = a.X < b.X ? a.X : b.X;
00556             result.Y = a.Y < b.Y ? a.Y : b.Y;
00557         }

static Vector2d OpenTK.Vector2d.Min ( Vector2d  a,
Vector2d  b 
) [static]

Calculate the component-wise minimum of two vectors.

Parameters:
a First operand
b Second operand
Returns:
The component-wise minimum

Definition at line 540 of file Vector2d.cs.

00541         {
00542             a.X = a.X < b.X ? a.X : b.X;
00543             a.Y = a.Y < b.Y ? a.Y : b.Y;
00544             return a;
00545         }

static void OpenTK.Vector2d.Mult ( ref Vector2d  a,
double  d,
out Vector2d  result 
) [static]

Multiply a vector and a scalar.

Parameters:
a Vector operand
d Scalar operand
result Result of the multiplication

Definition at line 335 of file Vector2d.cs.

00336         {
00337             result.X = a.X * d;
00338             result.Y = a.Y * d;
00339         }

static Vector2d OpenTK.Vector2d.Mult ( Vector2d  a,
double  d 
) [static]

Multiply a vector and a scalar.

Parameters:
a Vector operand
d Scalar operand
Returns:
Result of the multiplication

Definition at line 321 of file Vector2d.cs.

00322         {
00323             a.X *= d;
00324             a.Y *= d;
00325             return a;
00326         }

void OpenTK.Vector2d.Mult ( double  f  ) 

Multiply this instance by a scalar.

Parameters:
f Scalar operand.

Definition at line 138 of file Vector2d.cs.

00139         {
00140             this.X *= f;
00141             this.Y *= f;
00142         }

static void OpenTK.Vector2d.Multiply ( ref Vector2d  vector,
ref Vector2d  scale,
out Vector2d  result 
) [static]

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

Parameters:
vector Left operand.
scale Right operand.
result Result of the operation.

Definition at line 475 of file Vector2d.cs.

00476         {
00477             result = new Vector2d(vector.X * scale.X, vector.Y * scale.Y);
00478         }

static Vector2d OpenTK.Vector2d.Multiply ( Vector2d  vector,
Vector2d  scale 
) [static]

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

Parameters:
vector Left operand.
scale Right operand.
Returns:
Result of the operation.

Definition at line 463 of file Vector2d.cs.

00464         {
00465             Multiply(ref vector, ref scale, out vector);
00466             return vector;
00467         }

static void OpenTK.Vector2d.Multiply ( ref Vector2d  vector,
double  scale,
out Vector2d  result 
) [static]

Multiplies a vector by a scalar.

Parameters:
vector Left operand.
scale Right operand.
result Result of the operation.

Definition at line 452 of file Vector2d.cs.

00453         {
00454             result = new Vector2d(vector.X * scale, vector.Y * scale);
00455         }

static Vector2d OpenTK.Vector2d.Multiply ( Vector2d  vector,
double  scale 
) [static]

Multiplies a vector by a scalar.

Parameters:
vector Left operand.
scale Right operand.
Returns:
Result of the operation.

Definition at line 440 of file Vector2d.cs.

00441         {
00442             Multiply(ref vector, scale, out vector);
00443             return vector;
00444         }

static void OpenTK.Vector2d.Normalize ( ref Vector2d  vec,
out Vector2d  result 
) [static]

Scale a vector to unit length.

Parameters:
vec The input vector
result The normalized vector

Definition at line 641 of file Vector2d.cs.

00642         {
00643             double scale = 1.0 / vec.Length;
00644             result.X = vec.X * scale;
00645             result.Y = vec.Y * scale;
00646         }

static Vector2d OpenTK.Vector2d.Normalize ( Vector2d  vec  )  [static]

Scale a vector to unit length.

Parameters:
vec The input vector
Returns:
The normalized vector

Definition at line 628 of file Vector2d.cs.

00629         {
00630             double scale = 1.0 / vec.Length;
00631             vec.X *= scale;
00632             vec.Y *= scale;
00633             return vec;
00634         }

void OpenTK.Vector2d.Normalize (  ) 

Scales the Vector2 to unit length.

Definition at line 231 of file Vector2d.cs.

00232         {
00233             double scale = 1.0 / Length;
00234             X *= scale;
00235             Y *= scale;
00236         }

static void OpenTK.Vector2d.NormalizeFast ( ref Vector2d  vec,
out Vector2d  result 
) [static]

Scale a vector to approximately unit length.

Parameters:
vec The input vector
result The normalized vector

Definition at line 670 of file Vector2d.cs.

00671         {
00672             double scale = MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y);
00673             result.X = vec.X * scale;
00674             result.Y = vec.Y * scale;
00675         }

static Vector2d OpenTK.Vector2d.NormalizeFast ( Vector2d  vec  )  [static]

Scale a vector to approximately unit length.

Parameters:
vec The input vector
Returns:
The normalized vector

Definition at line 657 of file Vector2d.cs.

00658         {
00659             double scale = MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y);
00660             vec.X *= scale;
00661             vec.Y *= scale;
00662             return vec;
00663         }

static OpenTK.Vector2d.operator Vector2 ( Vector2d  v2d  )  [explicit, static]

Converts OpenTK.Vector2d to OpenTK.Vector2.

Parameters:
v2d The Vector2d to convert.
Returns:
The resulting Vector2.

Definition at line 924 of file Vector2d.cs.

00925         {
00926             return new Vector2((float)v2d.X, (float)v2d.Y);
00927         }

static OpenTK.Vector2d.operator Vector2d ( Vector2  v2  )  [explicit, static]

Converts OpenTK.Vector2 to OpenTK.Vector2d.

Parameters:
v2 The Vector2 to convert.
Returns:
The resulting Vector2d.

Definition at line 916 of file Vector2d.cs.

00917         {
00918             return new Vector2d(v2.X, v2.Y);
00919         }

static bool OpenTK.Vector2d.operator!= ( Vector2d  left,
Vector2d  right 
) [static]

Compares two instances for ienquality.

Parameters:
left The left instance.
right The right instance.
Returns:
True, if the instances are not equal; false otherwise.

Definition at line 908 of file Vector2d.cs.

00909         {
00910             return !left.Equals(right);
00911         }

static Vector2d OpenTK.Vector2d.operator* ( double  f,
Vector2d  vec 
) [static]

Multiply an instance by a scalar.

Parameters:
f The scalar.
vec The instance.
Returns:
The result of the operation.

Definition at line 870 of file Vector2d.cs.

00871         {
00872             vec.X *= f;
00873             vec.Y *= f;
00874             return vec;
00875         }

static Vector2d OpenTK.Vector2d.operator* ( Vector2d  vec,
double  f 
) [static]

Multiplies an instance by a scalar.

Parameters:
vec The instance.
f The scalar.
Returns:
The result of the operation.

Definition at line 857 of file Vector2d.cs.

00858         {
00859             vec.X *= f;
00860             vec.Y *= f;
00861             return vec;
00862         }

static Vector2d OpenTK.Vector2d.operator+ ( Vector2d  left,
Vector2d  right 
) [static]

Adds two instances.

Parameters:
left The left instance.
right The right instance.
Returns:
The result of the operation.

Definition at line 819 of file Vector2d.cs.

00820         {
00821             left.X += right.X;
00822             left.Y += right.Y;
00823             return left;
00824         }

static Vector2d OpenTK.Vector2d.operator- ( Vector2d  vec  )  [static]

Negates an instance.

Parameters:
vec The instance.
Returns:
The result of the operation.

Definition at line 844 of file Vector2d.cs.

00845         {
00846             vec.X = -vec.X;
00847             vec.Y = -vec.Y;
00848             return vec;
00849         }

static Vector2d OpenTK.Vector2d.operator- ( Vector2d  left,
Vector2d  right 
) [static]

Subtracts two instances.

Parameters:
left The left instance.
right The right instance.
Returns:
The result of the operation.

Definition at line 832 of file Vector2d.cs.

00833         {
00834             left.X -= right.X;
00835             left.Y -= right.Y;
00836             return left;
00837         }

static Vector2d OpenTK.Vector2d.operator/ ( Vector2d  vec,
double  f 
) [static]

Divides an instance by a scalar.

Parameters:
vec The instance.
f The scalar.
Returns:
The result of the operation.

Definition at line 883 of file Vector2d.cs.

00884         {
00885             double mult = 1.0 / f;
00886             vec.X *= mult;
00887             vec.Y *= mult;
00888             return vec;
00889         }

static bool OpenTK.Vector2d.operator== ( Vector2d  left,
Vector2d  right 
) [static]

Compares two instances for equality.

Parameters:
left The left instance.
right The right instance.
Returns:
True, if both instances are equal; false otherwise.

Definition at line 897 of file Vector2d.cs.

00898         {
00899             return left.Equals(right);
00900         }

void OpenTK.Vector2d.Scale ( ref Vector2d  scale  ) 

Scales this instance by the given parameter.

Parameters:
scale The scaling of the individual components.

Definition at line 267 of file Vector2d.cs.

00268         {
00269             this.X *= scale.X;
00270             this.Y *= scale.Y;
00271         }

void OpenTK.Vector2d.Scale ( Vector2d  scale  ) 

Scales this instance by the given parameter.

Parameters:
scale The scaling of the individual components.

Definition at line 257 of file Vector2d.cs.

00258         {
00259             this.X *= scale.X;
00260             this.Y *= scale.Y;
00261         }

void OpenTK.Vector2d.Scale ( double  sx,
double  sy 
)

Scales the current Vector2 by the given amounts.

Parameters:
sx The scale of the X component.
sy The scale of the Y component.

Definition at line 248 of file Vector2d.cs.

00249         {
00250             X *= sx;
00251             Y *= sy;
00252         }

static void OpenTK.Vector2d.Sub ( ref Vector2d  a,
ref Vector2d  b,
out Vector2d  result 
) [static]

Subtract one Vector from another.

Parameters:
a First operand
b Second operand
result Result of subtraction

Definition at line 304 of file Vector2d.cs.

00305         {
00306             result.X = a.X - b.X;
00307             result.Y = a.Y - b.Y;
00308         }

static Vector2d OpenTK.Vector2d.Sub ( Vector2d  a,
Vector2d  b 
) [static]

Subtract one Vector from another.

Parameters:
a First operand
b Second operand
Returns:
Result of subtraction

Definition at line 290 of file Vector2d.cs.

00291         {
00292             a.X -= b.X;
00293             a.Y -= b.Y;
00294             return a;
00295         }

void OpenTK.Vector2d.Sub ( ref Vector2d  right  ) 

Subtract the Vector passed as parameter from this instance.

Parameters:
right Right operand. This parameter is only read from.

Definition at line 125 of file Vector2d.cs.

00126         {
00127             this.X -= right.X;
00128             this.Y -= right.Y;
00129         }

void OpenTK.Vector2d.Sub ( Vector2d  right  ) 

Subtract the Vector passed as parameter from this instance.

Parameters:
right Right operand. This parameter is only read from.

Definition at line 115 of file Vector2d.cs.

00116         {
00117             this.X -= right.X;
00118             this.Y -= right.Y;
00119         }

static void OpenTK.Vector2d.Subtract ( ref Vector2d  a,
ref Vector2d  b,
out Vector2d  result 
) [static]

Subtract one Vector from another.

Parameters:
a First operand
b Second operand
result Result of subtraction

Definition at line 425 of file Vector2d.cs.

00426         {
00427             result = new Vector2d(a.X - b.X, a.Y - b.Y);
00428         }

static Vector2d OpenTK.Vector2d.Subtract ( Vector2d  a,
Vector2d  b 
) [static]

Subtract one Vector from another.

Parameters:
a First operand
b Second operand
Returns:
Result of subtraction

Definition at line 413 of file Vector2d.cs.

00414         {
00415             Subtract(ref a, ref b, out a);
00416             return a;
00417         }

override string OpenTK.Vector2d.ToString (  ) 

Returns a System.String that represents the current instance.

Returns:

Definition at line 939 of file Vector2d.cs.

00940         {
00941             return String.Format("({0}, {1})", X, Y);
00942         }

static void OpenTK.Vector2d.Transform ( ref Vector2d  vec,
ref Quaterniond  quat,
out Vector2d  result 
) [static]

Transforms a vector by a quaternion rotation.

Parameters:
vec The vector to transform.
quat The quaternion to rotate the vector by.
result The result of the operation.

Definition at line 797 of file Vector2d.cs.

00798         {
00799             Quaterniond v = new Quaterniond(vec.X, vec.Y, 0, 0), i, t;
00800             Quaterniond.Invert(ref quat, out i);
00801             Quaterniond.Multiply(ref quat, ref v, out t);
00802             Quaterniond.Multiply(ref t, ref i, out v);
00803 
00804             result = new Vector2d(v.X, v.Y);
00805         }

static Vector2d OpenTK.Vector2d.Transform ( Vector2d  vec,
Quaterniond  quat 
) [static]

Transforms a vector by a quaternion rotation.

Parameters:
vec The vector to transform.
quat The quaternion to rotate the vector by.
Returns:
The result of the operation.

Definition at line 784 of file Vector2d.cs.

00785         {
00786             Vector2d result;
00787             Transform(ref vec, ref quat, out result);
00788             return result;
00789         }


Member Data Documentation

readonly Vector2d OpenTK.Vector2d.One = new Vector2d(1, 1) [static]

Defines an instance with all components set to 1.

Definition at line 61 of file Vector2d.cs.

readonly int OpenTK.Vector2d.SizeInBytes = Marshal.SizeOf(new Vector2d()) [static]

Defines the size of the Vector2d struct in bytes.

Definition at line 66 of file Vector2d.cs.

Vector2d OpenTK.Vector2d.UnitX = new Vector2d(1, 0) [static]

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

Definition at line 46 of file Vector2d.cs.

Vector2d OpenTK.Vector2d.UnitY = new Vector2d(0, 1) [static]

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

Definition at line 51 of file Vector2d.cs.

The X coordinate of this instance.

Definition at line 38 of file Vector2d.cs.

The Y coordinate of this instance.

Definition at line 41 of file Vector2d.cs.

Vector2d OpenTK.Vector2d.Zero = new Vector2d(0, 0) [static]

Defines a zero-length Vector2d.

Definition at line 56 of file Vector2d.cs.


Property Documentation

double OpenTK.Vector2d.Length [get]

Gets the length (magnitude) of the vector.

See also:
LengthSquared

Definition at line 167 of file Vector2d.cs.

double OpenTK.Vector2d.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

Definition at line 187 of file Vector2d.cs.

Vector2d OpenTK.Vector2d.PerpendicularLeft [get]

Gets the perpendicular vector on the left side of this vector.

Definition at line 217 of file Vector2d.cs.

Vector2d OpenTK.Vector2d.PerpendicularRight [get]

Gets the perpendicular vector on the right side of this vector.

Definition at line 202 of file Vector2d.cs.

 All Classes Functions Variables Enumerations Properties Events

Generated on Tue Mar 9 14:59:16 2010 for The Open Toolkit library by  doxygen 1.6.1