Public Member Functions | Public Attributes | Friends

Carthesian::Vector3D Class Reference

List of all members.

Public Member Functions

 Vector3D (double x=0.0, double y=0.0, double z=0.0)
 constructor
 Vector3D (const Carthesian::Point3D &p1, const Carthesian::Point3D &p2)
 constructor from extremities
 Vector3D (const Vector3D &v)
 copy constructor
Vector3Doperator= (const Vector3D &v)
 affectation constructor
const Vector3D operator* (const double &val)
 dilation operator
const Vector3D operator/ (const double &val)
 reduction operator
void set (double x=0.0, double y=0.0, double z=0.0)
 geneal setter
double norm ()
 return the length of the segment

Public Attributes

double x
double y
double z

Friends

std::ostream & operator<< (std::ostream &os, const Vector3D &p)
 content printer

Detailed Description

3D vector


Constructor & Destructor Documentation

Carthesian::Vector3D::Vector3D ( double  x = 0.0,
double  y = 0.0,
double  z = 0.0 
)

constructor

Parameters:
x x component
y y component
z z component
Carthesian::Vector3D::Vector3D ( const Carthesian::Point3D p1,
const Carthesian::Point3D p2 
)

constructor from extremities

Parameters:
p1 point of origin
p2 end point
Carthesian::Vector3D::Vector3D ( const Vector3D v  ) 

copy constructor

Parameters:
v object to copy

Member Function Documentation

double Carthesian::Vector3D::norm (  ) 

return the length of the segment

Returns:
the length of the segment

Referenced by Carthesian::angle(), and Carthesian::Segment3D::to_unit_vector().

const Carthesian::Vector3D Carthesian::Vector3D::operator* ( const double &  val  ) 

dilation operator

Parameters:
val dilatation coefficient

References set().

const Carthesian::Vector3D Carthesian::Vector3D::operator/ ( const double &  val  ) 

reduction operator

Parameters:
val redution coefficient

References set().

Carthesian::Vector3D & Carthesian::Vector3D::operator= ( const Vector3D v  ) 

affectation constructor

Parameters:
v object to copy
void Carthesian::Vector3D::set ( double  x = 0.0,
double  y = 0.0,
double  z = 0.0 
)

geneal setter

Parameters:
x x component
y y component
z z component

Referenced by Carthesian::crossproduct(), Carthesian::dotproduct(), operator*(), and operator/().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Vector3D p 
) [friend]

content printer

Parameters:
os output flux
pixel current oject alias
Returns:
the content description added to the output flux

The documentation for this class was generated from the following files: