FlowVis.Math.Vector3f Class Reference

Vector class for three-dimensional vectors with floating values. More...

List of all members.

Public Member Functions

 Vector3f (float x, float y, float z)
 Constructor. Defines the coordinates of the vector.
 Vector3f (Vector3f other)
 Constructor. Copies the other vector to a new vector.
 Vector3f ()
 Constructor. All coordinates are set to 0.
void LoadZero ()
 Sets all coordinates to zero.
float Dot (Vector3f v)
 Calculates the dot product of this vector and another vector. Does the same as the static method.
Vector3f Cross (Vector3f v)
 Cross product of this vector with another vector.
bool IsNormalized ()
 Checks if the vector is normalized, i.e. it's norm has a value of 1.0.
float Norm ()
 Computes the norm (length) of the vector.
float Norm2 ()
 Computes the squared norm of this, that is the dot product of this vector with itself.
void Normalize ()
 Normalizes the vector.
float Distance2 (Vector3f v)
 Squared distance between this position vector and another position vector (norm2 of the difference vector).
float Distance (Vector3f v)
 Distance between this position vector and another position vector (norm of the difference vector).

Static Public Member Functions

static float Dot (Vector3f lhs, Vector3f rhs)
 Calculates the dot product of two vectors.
static Vector3f operator+ (Vector3f lhs, Vector3f rhs)
 Binary + operator. Adds each component of the first vector with the corresponding component of the second vector.
static Vector3f operator- (Vector3f v)
 Unary - operator. Inverts all components of the vectors.
static Vector3f operator- (Vector3f lhs, Vector3f rhs)
 Binary - operator.
static Vector3f operator/ (Vector3f lhs, float rhs)
 Divides each element of the vector by the scalar.
static Vector3f operator * (Vector3f lhs, float rhs)
 Multiplies each element of the vector with the scalar.
static Vector3f operator * (Vector3f lhs, Vector3f rhs)
 Multiplies each element of the vector with the same element of the second vector.
static Vector3f operator/ (Vector3f lhs, Vector3f rhs)
 Element-wise division.
static Vector3f operator * (float lhs, Vector3f rhs)
 Multiplies each element of the vector with the scalar.
static bool operator>= (Vector3f lhs, Vector3f rhs)
 returns true if all coordinates of lhs are greater or equal than rhs
static bool operator<= (Vector3f lhs, Vector3f rhs)
 returns true if all coordinates of lhs are lower or equal than rhs
static implicit operator float[] (Vector3f vector)
 Provides a cast operator to a float array which is needed e.g. for the glVertexfv method.

Properties

float X [get, set]
 value of x-coordinate
float Y [get, set]
 value of y-coordinate
float Z [get, set]
 value of z-coordinate
float this [int index] [get, set]
 Indexer for vector elements.


Detailed Description

Vector class for three-dimensional vectors with floating values.


Constructor & Destructor Documentation

FlowVis.Math.Vector3f.Vector3f ( float  x,
float  y,
float  z 
)

Constructor. Defines the coordinates of the vector.

Parameters:
x x-coordinate of new vector
y y-coordinate of new vector
z z-coordinate of new vector

FlowVis.Math.Vector3f.Vector3f ( Vector3f  other  ) 

Constructor. Copies the other vector to a new vector.

Parameters:
other vector which should be copied

FlowVis.Math.Vector3f.Vector3f (  ) 

Constructor. All coordinates are set to 0.


Member Function Documentation

void FlowVis.Math.Vector3f.LoadZero (  ) 

Sets all coordinates to zero.

static float FlowVis.Math.Vector3f.Dot ( Vector3f  lhs,
Vector3f  rhs 
) [static]

Calculates the dot product of two vectors.

Parameters:
lhs 
rhs 
Returns:

float FlowVis.Math.Vector3f.Dot ( Vector3f  v  ) 

Calculates the dot product of this vector and another vector. Does the same as the static method.

Parameters:
v 
Returns:

Vector3f FlowVis.Math.Vector3f.Cross ( Vector3f  v  ) 

Cross product of this vector with another vector.

Parameters:
v the other vector to calculate the cross product with
Returns:
vector which is normal to this vector as well as to the other vector

bool FlowVis.Math.Vector3f.IsNormalized (  ) 

Checks if the vector is normalized, i.e. it's norm has a value of 1.0.

Returns:
true if the vector is normalized

float FlowVis.Math.Vector3f.Norm (  ) 

Computes the norm (length) of the vector.

Returns:
norm (length)

float FlowVis.Math.Vector3f.Norm2 (  ) 

Computes the squared norm of this, that is the dot product of this vector with itself.

Returns:
squared norm

void FlowVis.Math.Vector3f.Normalize (  ) 

Normalizes the vector.

float FlowVis.Math.Vector3f.Distance2 ( Vector3f  v  ) 

Squared distance between this position vector and another position vector (norm2 of the difference vector).

Parameters:
v vector for which the distance to this vector should be calulated
Returns:
squared norm of difference vector

float FlowVis.Math.Vector3f.Distance ( Vector3f  v  ) 

Distance between this position vector and another position vector (norm of the difference vector).

Parameters:
v vector for which the distance to this vector should be calulated
Returns:
norm of difference vector

static Vector3f FlowVis.Math.Vector3f.operator+ ( Vector3f  lhs,
Vector3f  rhs 
) [static]

Binary + operator. Adds each component of the first vector with the corresponding component of the second vector.

Parameters:
lhs left-hand side operator of addition
rhs right-hand side operator of addition
Returns:
sum of both vectors

static Vector3f FlowVis.Math.Vector3f.operator- ( Vector3f  v  )  [static]

Unary - operator. Inverts all components of the vectors.

Parameters:
v vector which should be inverted
Returns:
inverted vector

static Vector3f FlowVis.Math.Vector3f.operator- ( Vector3f  lhs,
Vector3f  rhs 
) [static]

Binary - operator.

Parameters:
lhs left-hand side operator of subtraction
rhs right-hand side operator of subtraction
Returns:
result of subtraction

static Vector3f FlowVis.Math.Vector3f.operator/ ( Vector3f  lhs,
float  rhs 
) [static]

Divides each element of the vector by the scalar.

Parameters:
lhs left-hand side operator of division
rhs right-hand side operator of division
Returns:
result of division

static Vector3f FlowVis.Math.Vector3f.operator * ( Vector3f  lhs,
float  rhs 
) [static]

Multiplies each element of the vector with the scalar.

Parameters:
lhs left-hand side operator of multiplication
rhs right-hand side operator of multiplication
Returns:

static Vector3f FlowVis.Math.Vector3f.operator * ( Vector3f  lhs,
Vector3f  rhs 
) [static]

Multiplies each element of the vector with the same element of the second vector.

Parameters:
lhs left-hand side operator of multiplication
rhs right-hand side operator of multiplication
Returns:

static Vector3f FlowVis.Math.Vector3f.operator/ ( Vector3f  lhs,
Vector3f  rhs 
) [static]

Element-wise division.

Parameters:
lhs left-hand side operator of division
rhs right-hand side operator of division
Returns:

static Vector3f FlowVis.Math.Vector3f.operator * ( float  lhs,
Vector3f  rhs 
) [static]

Multiplies each element of the vector with the scalar.

Parameters:
lhs 
rhs 
Returns:

static bool FlowVis.Math.Vector3f.operator>= ( Vector3f  lhs,
Vector3f  rhs 
) [static]

returns true if all coordinates of lhs are greater or equal than rhs

Parameters:
lhs 
rhs 
Returns:

static bool FlowVis.Math.Vector3f.operator<= ( Vector3f  lhs,
Vector3f  rhs 
) [static]

returns true if all coordinates of lhs are lower or equal than rhs

Parameters:
lhs 
rhs 
Returns:

static implicit FlowVis.Math.Vector3f.operator float[] ( Vector3f  vector  )  [static]

Provides a cast operator to a float array which is needed e.g. for the glVertexfv method.

Parameters:
vector 
Returns:


Property Documentation

float FlowVis.Math.Vector3f.X [get, set]

value of x-coordinate

float FlowVis.Math.Vector3f.Y [get, set]

value of y-coordinate

float FlowVis.Math.Vector3f.Z [get, set]

value of z-coordinate

float FlowVis.Math.Vector3f.this[int index] (  )  [get, set]

Indexer for vector elements.

Parameters:
index 
Returns:


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 16:09:36 2008 for FlowVis by  doxygen 1.5.1-p1