AgateLib.Geometry.Vector2 Struct Reference

Structure which describes a vector in 2-space. The Vector2 class contains overloads for mathematical operations to make computation expressions involving the Vector2 simple and expressive. More...

List of all members.

Public Member Functions

 Vector2 (float x, float y)
 Constructs a Vector2 object.
 Vector2 (double x, double y)
 Constructs a Vector2 object.
Vector2 Normalize ()
 Returns a vector pointing in the same direction as this one, with magnitude 1.
float DotProduct (Vector2 b)
 Computes and returns the dot product with another vector.

Static Public Member Functions

static operator Vector3 (Vector2 v)
 Converts to a Vector3 object, with a Z value of zero.
static Vector2 operator+ (Vector2 a, Vector2 b)
 Adds two vectors.
static Vector2 operator- (Vector2 a, Vector2 b)
 Subtracts two vectors.
static Vector2 operator- (Vector2 a)
 Unary - operator: multiples vector by -1.
static Vector2 operator* (Vector2 a, float b)
 Scales a vector by a scalar floating point value.
static Vector2 operator/ (Vector2 a, float b)
 Divides a vector's components by a floating point value.
static float DotProduct (Vector2 a, Vector2 b)
 Computes and returns the dot product between two vectors.

Static Public Attributes

static readonly Vector2 Empty = new Vector2()
 Vector representing the origin.

Properties

float X [get, set]
 X coordinate.
float Y [get, set]
 Y coordinate.
bool IsEmpty [get]
 Returns true if this vector has zero for all components.
float MagnitudeSquared [get]
 Returns the square of the length of the vector.
float Magnitude [get]
 Returns the length of the vector.


Detailed Description

Structure which describes a vector in 2-space. The Vector2 class contains overloads for mathematical operations to make computation expressions involving the Vector2 simple and expressive.


Constructor & Destructor Documentation

AgateLib.Geometry.Vector2.Vector2 ( float  x,
float  y 
)

Constructs a Vector2 object.

Parameters:
x 
y 

AgateLib.Geometry.Vector2.Vector2 ( double  x,
double  y 
)

Constructs a Vector2 object.

Parameters:
x 
y 


Member Function Documentation

static float AgateLib.Geometry.Vector2.DotProduct ( Vector2  a,
Vector2  b 
) [static]

Computes and returns the dot product between two vectors.

Parameters:
a 
b 
Returns:

float AgateLib.Geometry.Vector2.DotProduct ( Vector2  b  ) 

Computes and returns the dot product with another vector.

Parameters:
b 
Returns:

Vector2 AgateLib.Geometry.Vector2.Normalize (  ) 

Returns a vector pointing in the same direction as this one, with magnitude 1.

Returns:

static AgateLib.Geometry.Vector2.operator Vector3 ( Vector2  v  )  [explicit, static]

Converts to a Vector3 object, with a Z value of zero.

Parameters:
v 
Returns:

static Vector2 AgateLib.Geometry.Vector2.operator* ( Vector2  a,
float  b 
) [static]

Scales a vector by a scalar floating point value.

Parameters:
a 
b 
Returns:

static Vector2 AgateLib.Geometry.Vector2.operator+ ( Vector2  a,
Vector2  b 
) [static]

Adds two vectors.

Parameters:
a 
b 
Returns:

static Vector2 AgateLib.Geometry.Vector2.operator- ( Vector2  a  )  [static]

Unary - operator: multiples vector by -1.

Parameters:
a 
Returns:

static Vector2 AgateLib.Geometry.Vector2.operator- ( Vector2  a,
Vector2  b 
) [static]

Subtracts two vectors.

Parameters:
a 
b 
Returns:

static Vector2 AgateLib.Geometry.Vector2.operator/ ( Vector2  a,
float  b 
) [static]

Divides a vector's components by a floating point value.

Parameters:
a 
b 
Returns:


Member Data Documentation

readonly Vector2 AgateLib.Geometry.Vector2.Empty = new Vector2() [static]

Vector representing the origin.


Property Documentation

bool AgateLib.Geometry.Vector2.IsEmpty [get]

Returns true if this vector has zero for all components.

float AgateLib.Geometry.Vector2.Magnitude [get]

Returns the length of the vector.

float AgateLib.Geometry.Vector2.MagnitudeSquared [get]

Returns the square of the length of the vector.

float AgateLib.Geometry.Vector2.X [get, set]

X coordinate.

float AgateLib.Geometry.Vector2.Y [get, set]

Y coordinate.


The documentation for this struct was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo