/Users/carl/Desktop/Rim Physics/Source/Physics/Framework/Utilities/Math/rimPhysicsVector2D.h File Reference

#include "rimPhysicsMath.h"

Classes

class  Vector2D< T >
 A templatized math class representing a 2-dimensional vector. More...

Functions

template<typename T>
Vector2D< T > operator+ (const T &value, const Vector2D< T > &vector)
 Add a value to every component of the vector.
template<typename T>
Vector2D< T > operator- (const T &value, const Vector2D< T > &vector)
 Subtract every component of the vector from the value, returning a vector result.
template<typename T>
Vector2D< T > operator * (const T &value, const Vector2D< T > &vector)
 Multiply every component of the vector with the value, returning a vector result.
template<typename T>
Vector2D< T > operator/ (const T &value, const Vector2D< T > &vector)
 Divide a value by every component of the vector, returning a vector result.
template<typename T>
dot (const Vector2D< T > &vector1, const Vector2D< T > &vector2)
 Compute and return the dot product of two vectors.
template<typename T>
Vector2D< T > perp (const Vector2D< T > &vector)
 Compute and return the perp product of one vector.
template<typename T>
Vector2D< T > midpoint (const Vector2D< T > &vector1, const Vector2D< T > &vector2)
 Compute the midpoint of two vectors.

Function Documentation

template<typename T>
T dot ( const Vector2D< T > &  vector1,
const Vector2D< T > &  vector2 
) [inline]

Compute and return the dot product of two vectors.

This method adds all components of the component-wise multiplication of the two vectors together and returns the scalar result. It does not modify either of the original vectors. If the dot product is zero, then the two vectors are perpendicular.

Parameters:
vector1 - The first vector of the dot product.
vector2 - The second vector of the dot product.
Returns:
The dot product of the two vector parameters.

template<typename T>
Vector2D<T> midpoint ( const Vector2D< T > &  vector1,
const Vector2D< T > &  vector2 
) [inline]

Compute the midpoint of two vectors.

This method adds the two vector parameters together component-wise and then multiplies by 1/2, resulting in a point in 3D space at the midpoint between the two vectors. The midpoint is essentially the component-wise average of two vectors. Both original vectors are not modified.

Parameters:
vector1 - The first vector of the midpoint calculation.
vector2 - The second vector of the midpoint calculation.
Returns:
The midpoint of the two vector parameters.

template<typename T>
Vector2D<T> operator * ( const T &  value,
const Vector2D< T > &  vector 
) [inline]

Multiply every component of the vector with the value, returning a vector result.

This operator multiplies every component of the 2nd paramter, a vector, from the 1st paramter, a value, and then returns a vector containing the resulting vectoral components. This operator does not modify the orignal vector.

Parameters:
value - The value to multiply with all components of the vector.
vector - The vector to be multiplied with.
Returns:
The resulting vector of this multiplication.

template<typename T>
Vector2D<T> operator+ ( const T &  value,
const Vector2D< T > &  vector 
) [inline]

Add a value to every component of the vector.

This operator adds the value parameter to every component of the vector, and returns a vector representing this result. It does not modifiy the original vector.

Parameters:
value - The value to add to all components of the vector.
vector - The vector to be added to.
Returns:
The resulting vector of this addition.

template<typename T>
Vector2D<T> operator- ( const T &  value,
const Vector2D< T > &  vector 
) [inline]

Subtract every component of the vector from the value, returning a vector result.

This operator subtracts every component of the 2nd paramter, a vector, from the 1st paramter, a value, and then returns a vector containing the resulting vectoral components. This operator does not modify the orignal vector.

Parameters:
value - The value to subtract all components of the vector from.
vector - The vector to be subtracted.
Returns:
The resulting vector of this subtraction.

template<typename T>
Vector2D<T> operator/ ( const T &  value,
const Vector2D< T > &  vector 
) [inline]

Divide a value by every component of the vector, returning a vector result.

This operator divides the provided value by every component of the vector, returning a vector representing the component-wise division. The operator does not modify the original vector.

Parameters:
value - The value to be divided by all components of the vector.
vector - The vector to be divided by.
Returns:
The resulting vector of this division.

template<typename T>
Vector2D<T> perp ( const Vector2D< T > &  vector  )  [inline]

Compute and return the perp product of one vector.

This method computes and returns a vector representing the perp product of the parameter vector. This vector should be perpendicular to the original vector and have the same magnitude. It does not modify the original vector.

Parameters:
vector - The vector to be rotated 90 degrees.
Returns:
The perp product vector of the vector parameter.


Generated on Tue Aug 26 00:03:17 2008 for Rim Physics by  doxygen 1.5.4