#include <Vector2.h>
This class is part of the basic Tools namespace and contains a couple of methods for initialization and computing various 2-element vectors (2 dimensional vectors).
For using vector with more elements (e.g. 3 or 4 elements) please see the following classes Vector3 and Vector4.
Vector4 the four dimensional vector.
Public Member Functions | |
Vector2 (void) | |
This is the standard constructor. | |
Vector2 (double n_X, double n_Y) | |
Constructor initialization by two parameters. | |
Vector2 (double n_Value __gc[]) | |
Constructor initialization by an array parameters. | |
__property double | get_X (void) |
Returns the x element of the specific vector. | |
__property double | get_Y (void) |
Returns the y element of the specific vector. | |
__property void | set_X (double n_X) |
Sets the x element of the existing vector. | |
__property void | set_Y (double n_Y) |
Sets the y-element of the existing vector. | |
double | magnitude (void) |
Returns the magnitude of the specific vector. | |
Static Public Member Functions | |
static Vector2 * | CreateNormalizedVector (Vector2 *v) |
This static function created a normalized vector of the specified vector parameter. | |
static Vector2 * | Addition (Vector2 *v1, Vector2 *v2) |
This static function returns the sum vector of the two specified vector parameters. | |
static Vector2 * | Subtraction (Vector2 *v1, Vector2 *v2) |
This static function returns the subtraction vector of the two specified vector parameters. | |
Public Attributes | |
double | m_X |
The x element of the vector. | |
double | m_Y |
The y element of the vector. |
|
This is the standard constructor. This standard constructor initialzed both elements with zero. |
|
Constructor initialization by two parameters. This constructor initialized both element of the vector with the specified parameters.
|
|
Constructor initialization by an array parameters. This constructor initialized both element of the vector with the specified array parameter.
|
|
This static function returns the sum vector of the two specified vector parameters.
|
|
This static function created a normalized vector of the specified vector parameter.
|
|
Returns the x element of the specific vector.
|
|
Returns the y element of the specific vector.
|
|
Returns the magnitude of the specific vector.
|
|
Sets the x element of the existing vector.
|
|
Sets the y-element of the existing vector.
|
|
This static function returns the subtraction vector of the two specified vector parameters.
|
|
The x element of the vector. The x element is the first element and is based on a double variable. |
|
The y element of the vector. The y element is the second element and is based on a double variable. |