Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CL_Vector Class Reference

clanCore="Math". More...

#include <cl_vector.h>

List of all members.

Public Methods

 CL_Vector (float x=0.0, float y=0.0, float z=0.0, float w=1.0)
 CL_Vector (const CL_Vector &other)
float norm () const
 param: other - vector to copy.

void normalize ()
 retval: the euclid norm of the vector (in R^3).

float dot (const CL_Vector &v) const
float angle (const CL_Vector &v) const
 param: v - other vector retval: the dot product of the two vectors.

CL_Vector cross (const CL_Vector &v) const
 param: v - other vector retval: the angle between the two vectors.

CL_Vector rotate (float angle, const CL_Vector &a) const
 param: v - other vector retval: the cross product of the two vectors.

void round ()
 param: angle - angle to rotateparam: a - rotation axisretval: the rotated vector.

CL_Vector operator * (float s)
void operator+= (const CL_Vector &v)
 retval: the scalar product.

void operator-= (const CL_Vector &v)
void operator *= (float s)
CL_Vector operator+ (const CL_Vector &v)
CL_Vector operator- (const CL_Vector &v)
CL_Vector operator- ()
CL_Vector& operator= (const CL_Vector &v)
int operator== (const CL_Vector &v) const
int operator!= (const CL_Vector &v) const
 param: v - other vectorretval: true if v equals the current vector, false otherwise.

float& operator[] (int n)
 param: v - other vectorretval: false if v equals the current vector, true otherwise.


Public Attributes

float x
float y
float z
float w

Friends

CL_Vector operator * (float s, const CL_Vector &v)
 retval: the scalar product.

std::ostream& operator<< (std::ostream &, CL_Vector &v)
 param: n - number of ordinate (starting with 0)retval: reference to the n-th ordinate.


Detailed Description

clanCore="Math".

Definition at line 25 of file cl_vector.h.


Constructor & Destructor Documentation

CL_Vector::CL_Vector ( float x = 0.0,
float y = 0.0,
float z = 0.0,
float w = 1.0 )
 

CL_Vector::CL_Vector ( const CL_Vector & other )
 


Member Function Documentation

float CL_Vector::angle ( const CL_Vector & v ) const
 

param: v - other vector retval: the dot product of the two vectors.

CL_Vector CL_Vector::cross ( const CL_Vector & v ) const
 

param: v - other vector retval: the angle between the two vectors.

float CL_Vector::dot ( const CL_Vector & v ) const
 

float CL_Vector::norm ( ) const
 

param: other - vector to copy.

void CL_Vector::normalize ( )
 

retval: the euclid norm of the vector (in R^3).

CL_Vector CL_Vector::operator * ( float s )
 

void CL_Vector::operator *= ( float s )
 

int CL_Vector::operator!= ( const CL_Vector & v ) const
 

param: v - other vectorretval: true if v equals the current vector, false otherwise.

CL_Vector CL_Vector::operator+ ( const CL_Vector & v )
 

void CL_Vector::operator+= ( const CL_Vector & v )
 

retval: the scalar product.

CL_Vector CL_Vector::operator- ( )
 

CL_Vector CL_Vector::operator- ( const CL_Vector & v )
 

void CL_Vector::operator-= ( const CL_Vector & v )
 

CL_Vector& CL_Vector::operator= ( const CL_Vector & v )
 

int CL_Vector::operator== ( const CL_Vector & v ) const
 

float & CL_Vector::operator[] ( int n )
 

param: v - other vectorretval: false if v equals the current vector, true otherwise.

CL_Vector CL_Vector::rotate ( float angle,
const CL_Vector & a ) const
 

param: v - other vector retval: the cross product of the two vectors.

void CL_Vector::round ( )
 

param: angle - angle to rotateparam: a - rotation axisretval: the rotated vector.


Friends And Related Function Documentation

CL_Vector operator * ( float s,
const CL_Vector & v ) [friend]
 

retval: the scalar product.

Definition at line 117 of file cl_vector.cpp.

std::ostream & operator<< ( std::ostream & os,
CL_Vector & v ) [friend]
 

param: n - number of ordinate (starting with 0)retval: reference to the n-th ordinate.

Definition at line 209 of file cl_vector.cpp.


Member Data Documentation

float CL_Vector::w
 

Definition at line 30 of file cl_vector.h.

float CL_Vector::x
 

Definition at line 30 of file cl_vector.h.

float CL_Vector::y
 

Definition at line 30 of file cl_vector.h.

float CL_Vector::z
 

Definition at line 30 of file cl_vector.h.


The documentation for this class was generated from the following file:
Generated at Wed Apr 4 19:57:37 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001