#include <Vector4.h>
This class is part of the basic Tools namespace and contains a couple of methods for initialization and computing various 4-element vectors (4 dimensional vectors). Espacially the inner (see Vector4.DotProd) and outer (see Vector4.CrossProd) product methods.
For using vector with more or less elements (e.g. 2 or 3 elements) please see the following classes Vector2 and Vector3.
Vector3 the four dimensional vector.
Public Member Functions | |
Vector4 (void) | |
This is the standard constructor. | |
Vector4 (double n_X, double n_Y, double n_Z, double n_W) | |
Constructor initialization by three parameters. | |
Vector4 (double n_Value __gc[]) | |
Constructor initialization by an array parameters. | |
Vector4 (Vector3 *n_Vector3, double n_W) | |
Constructor initialization by an already existing Vector4 object. | |
__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 double | get_Z (void) |
Returns the z element of the specific vector. | |
__property double | get_W (void) |
Returns the w 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. | |
__property void | set_Z (double n_Z) |
Sets the z element of the existing vector. | |
__property void | set_W (double n_W) |
Sets the w element of the existing vector. | |
double | dotProd (Vector4 *v) |
This function returns the dot product (inner product) of the current Vector4 object and the specified vector parameter. | |
Vector4 * | multSkalar (double d) |
This function returns the skalar product as a new Vector4 object of the current Vector4 object and the specified skalar parameter. | |
double | magnitude (void) |
Returns the magnitude of the specific vector. | |
void | normalize (void) |
This function normalizes the current vector. | |
double | getItem (int index) |
This function returns the specific element of the current vector. | |
Vector4 * | getNegativeVector (void) |
This function returns the negative vector of the current Vector4 object. | |
float | getFloatArrayOfVector (void) __gc[] |
This function returns the all vector elements as an three element float array. | |
double | getDoubleArrayOfVector (void) __gc[] |
This function returns the all vector elements as an three element double array. | |
Vector3 * | getVector3 (void) |
This function returns a new instance of the Vector3 class which contains the firest three elements of the current Vector4 object divided by the w element. | |
Static Public Member Functions | |
static Vector4 * | CreateNormalizedVector (Vector4 *v) |
This static function created a normalized vector of the specified vector parameter. | |
static Vector4 * | Addition (Vector4 *v1, Vector4 *v2) |
This static function returns the sum vector of the two specified vector parameters. | |
static Vector4 * | Subtraction (Vector4 *v1, Vector4 *v2) |
This static function returns the subtraction vector of the two specified vector parameters. | |
static Vector4 * | CrossProd (Vector4 *v1, Vector4 *v2) |
This static function returns the cross product (outer product) vector of the two specified vector parameters. | |
static double | DotProd (Vector4 *v1, Vector4 *v2) |
This static function returns the dot product (inner product) of the two specified vector parameters. | |
static Vector3 * | GetVector3 (Vector4 *n_Vector4) |
This static function returns a new instance of the Vector3 class which contains the firest three elements of the current Vector4 object divided by the w element. | |
static Vector4 * | GetVector4OfVector3 (Vector3 *n_Vector3) |
This static function initalizied a new Vector4 object by the specified Vector3 instance. | |
Private Attributes | |
double | m_X |
The x element of the vector. | |
double | m_Y |
The y element of the vector. | |
double | m_Z |
The z element of the vector. | |
double | m_W |
The w element of the vector. |
|
This is the standard constructor. This standard constructor initialized all four elements with zero. |
|
Constructor initialization by three parameters. This constructor initialized all four element of the vector with the specified parameters.
|
|
Constructor initialization by an array parameters. This constructor initialized all four element of the vector with the specified array parameter.
|
|
Constructor initialization by an already existing Vector4 object. This constructor initialized all three element of the vector with the values of the specified Vector4 object.
|
|
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.
|
|
This static function returns the cross product (outer product) vector of the two specified vector parameters.
|
|
This static function returns the dot product (inner product) of the two specified vector parameters.
|
|
This function returns the dot product (inner product) of the current Vector4 object and the specified vector parameter.
|
|
Returns the w element of the specific vector.
|
|
Returns the x element of the specific vector.
|
|
Returns the y element of the specific vector.
|
|
Returns the z element of the specific vector.
|
|
This function returns the all vector elements as an three element double array.
|
|
This function returns the all vector elements as an three element float array.
|
|
This function returns the specific element of the current vector.
This element is specified by the specified parameter whereas the following index enumeration is valid:
|
|
This function returns the negative vector of the current Vector4 object. This means that the current vector is multiplied with -1 which is actually a skalar product.
|
|
This static function returns a new instance of the Vector3 class which contains the firest three elements of the current Vector4 object divided by the w element. This means that the x,y and z element will be divided by the w element and afterwards copied to the new Vector3 instance.
|
|
This function returns a new instance of the Vector3 class which contains the firest three elements of the current Vector4 object divided by the w element. This means that the x,y and z element will be divided by the w element and afterwards copied to the new Vector3 instance.
|
|
This static function initalizied a new Vector4 object by the specified Vector3 instance. Hereby should be noted that the fourth element will be invariably set to zero.
|
|
Returns the magnitude of the specific vector.
|
|
This function returns the skalar product as a new Vector4 object of the current Vector4 object and the specified skalar parameter.
|
|
This function normalizes the current vector.
|
|
Sets the w element of the existing vector.
|
|
Sets the x element of the existing vector.
|
|
Sets the y element of the existing vector.
|
|
Sets the z element of the existing vector.
|
|
This static function returns the subtraction vector of the two specified vector parameters.
|
|
The w element of the vector. The w element is the fourth element and is based on a double variable. |
|
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. |
|
The z element of the vector. The z element is the third element and is based on a double variable. |