Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxVectorR2 Class Reference

Class definition for vectors in R2 (real-value coordinates). More...

#include <HxVectorR2.h>

List of all members.

Public Methods

 HxVectorR2 ()
 Constructor. More...

 HxVectorR2 (double d1, double d2)
 Constructor. More...

 HxVectorR2 (const HxPointR2 &p1, const HxPointR2 &p2)
 Constructor : p1-p2. More...

double x () const
 Get the first element of the vector. More...

double y () const
 Get the second element of the vector. More...

HxVectorR2 add (const HxVectorR2 &arg) const
 Add the given vector to this. More...

HxVectorR2 sub (const HxVectorR2 &arg) const
 Subtract the given vector from this. More...

HxVectorR2 mul (double arg) const
 Multiply this vector with a scalar. More...

HxVectorR2 div (double arg) const
 Divide this vector by a scalar. More...

double dot (const HxVectorR2 &arg) const
 Dot product. More...

double cross2D (const HxVectorR2 &arg) const
 Cross product (?). More...

double magnitude () const
 Magnitude. More...

double squaredMagnitude () const
 Squared magnitude. More...

HxVectorR2 normal () const
 Normal. More...

STD_OSTREAM & put (STD_OSTREAM &) const
 Put the arrow on the given stream. More...

STD_OSTREAM & dump (HxVectorR2 &) const
HxString toString () const

Friends

class HxPointR2


Detailed Description

Class definition for vectors in R2 (real-value coordinates).


Constructor & Destructor Documentation

HxVectorR2::HxVectorR2   [inline]
 

Constructor.

00087                        : _data(0,0)
00088 {
00089 }

HxVectorR2::HxVectorR2 double    d1,
double    d2
[inline]
 

Constructor.

00092                                            : _data(d1, d2)
00093 {
00094 }

HxVectorR2::HxVectorR2 const HxPointR2   p1,
const HxPointR2   p2
 

Constructor : p1-p2.

00016 {
00017     _data = HxVec2Double(p1.x()-p2.x(), p1.y()-p2.y());
00018 }


Member Function Documentation

double HxVectorR2::x   const [inline]
 

Get the first element of the vector.

00098 {
00099     return _data.x();
00100 }

double HxVectorR2::y   const [inline]
 

Get the second element of the vector.

00104 {
00105     return _data.y();
00106 }

HxVectorR2 HxVectorR2::add const HxVectorR2 &    arg const [inline]
 

Add the given vector to this.

00110 {
00111     return HxVectorR2( _data.x()+arg.x(), _data.y()+arg.y()); 
00112 }

HxVectorR2 HxVectorR2::sub const HxVectorR2 &    arg const [inline]
 

Subtract the given vector from this.

00116 {
00117     return HxVectorR2( _data.x()-arg.x(), _data.y()-arg.y()); 
00118 }

HxVectorR2 HxVectorR2::mul double    arg const [inline]
 

Multiply this vector with a scalar.

00122 {
00123     return HxVectorR2( _data.x()*arg, _data.y()*arg); 
00124 }

HxVectorR2 HxVectorR2::div double    arg const [inline]
 

Divide this vector by a scalar.

00128 {
00129     return HxVectorR2( _data.x()/arg, _data.y()/arg); 
00130 }

double HxVectorR2::dot const HxVectorR2 &    arg const [inline]
 

Dot product.

00134 {
00135     return _data.dot(arg._data).x();
00136 }

double HxVectorR2::cross2D const HxVectorR2 &    arg const [inline]
 

Cross product (?).

00140 {
00141     return _data.x()*arg.y() + _data.y()*arg.x();
00142 }

double HxVectorR2::magnitude   const [inline]
 

Magnitude.

00146 {
00147     return _data.norm2().x();
00148 }

double HxVectorR2::squaredMagnitude   const [inline]
 

Squared magnitude.

00152 {
00153     return _data.x()*_data.x() + _data.y()*_data.y();
00154 }

HxVectorR2 HxVectorR2::normal   const [inline]
 

Normal.

00158 {
00159     return HxVectorR2(_data.y(), -_data.x()); 
00160 }

STD_OSTREAM & HxVectorR2::put STD_OSTREAM &    os const [inline]
 

Put the arrow on the given stream.

00170 {
00171     return os << _data;
00172 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 3 14:19:11 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001