Polycode::Vector3 Class Reference

3D Vector class. More...

Inherited by Polycode::Vertex.

List of all members.

Public Member Functions

 Vector3 (Number x, Number y, Number z)
 Create from x,y,z coordinates.
 Vector3 (Number val)
 Create from single value for all coordinates.
 Vector3 ()
 Default constructor.
void set (Number x, Number y, Number z)
 Sets the vector from x,y,z coordinates.
Number distance (const Vector3 &vec2) const
 Returns the distance from this vector to another one.
Number angleBetween (const Vector3 &dest)
 Returns the angle between this and the specified vectors.
Number length () const
 Returns the vector length.
Number dot (const Vector3 &u) const
 Returns the dot product with another vector.
Vector3 crossProduct (const Vector3 &vec2) const
 Returns the cross product with another vector.
void Normalize ()
 Normalizes the vector.
Operators

Available vector operators.

Vector3 operator* (const Number val) const
Vector3 operator/ (const Number val) const
Vector3operator= (const Vector3 &v2)
Vector3operator+= (const Vector3 &v2)
Vector3operator-= (const Vector3 &v2)
Vector3 operator+ (const Vector3 &v2) const
bool operator== (const Vector3 &v2)
bool operator!= (const Vector3 &v2)

Public Attributes

Number x
 X coordinate.
Number y
 Y coordinate.
Number z
 Z coordinate.

Detailed Description

3D Vector class.


Constructor & Destructor Documentation

Vector3::Vector3 ( Number  x,
Number  y,
Number  z 
)

Create from x,y,z coordinates.

Parameters:
x X coordinate.
y Y coordinate.
z Z coordinate.
Vector3::Vector3 ( Number  val  ) 

Create from single value for all coordinates.

Parameters:
val Value for all coordinates

Member Function Documentation

Number Polycode::Vector3::angleBetween ( const Vector3 dest  )  [inline]

Returns the angle between this and the specified vectors.

Returns:
Angle between the vectors
Vector3 Polycode::Vector3::crossProduct ( const Vector3 vec2  )  const [inline]

Returns the cross product with another vector.

Parameters:
vec2 Second vector.
Returns:
Cross product with the vector.
Number Polycode::Vector3::distance ( const Vector3 vec2  )  const [inline]

Returns the distance from this vector to another one.

Parameters:
vec2 Second vector.
Returns:
Distance to the other vector.
Number Polycode::Vector3::dot ( const Vector3 u  )  const [inline]

Returns the dot product with another vector.

Returns:
Dor product with the vector.
Number Polycode::Vector3::length (  )  const [inline]

Returns the vector length.

Returns:
Length of the vector.
void Vector3::set ( Number  x,
Number  y,
Number  z 
)

Sets the vector from x,y,z coordinates.

Parameters:
x X coordinate.
y Y coordinate.
z Z coordinate.
Generated on Sat Aug 11 18:04:12 2012 for Polycode by  doxygen 1.6.3