| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Gaudi::Math::Line< aPoint, aVector > Class Template Reference

A very simple class to describe a 3D-line. More...

#include <Kernel/Line.h>

Collaboration diagram for Gaudi::Math::Line< aPoint, aVector >:

[legend]
List of all members.

Public Types

typedef aPoint Point
typedef aVector Vector

Public Member Functions

 Line ()
 the default constructor
 Line (const aPoint &p0, const aVector &v0)
 the constructor from the point and direction vector
 Line (const aPoint &p0, const aPoint &p1)
 the constructor from two points:
const aPoint & beginPoint () const
 Return the point of origin.
const aVector & direction () const
 Return the direction vector of the line.
aPoint position (const double mu) const
 Return a point on the line tick direction vectors away from point of origin: $ \vec{\mathbf{P}}\left(\mu\right) = \vec{\mathbf{P}}_0 + \mu\vec{\mathbf{V}} $.
aPoint operator() (const double mu) const
 Return a point on the line tick direction vectors away from point of origin: $ \vec{\mathbf{P}}\left(\mu\right) = \vec{\mathbf{P}}_0 + \mu\vec{\mathbf{V}} $.
std::ostream & fillStream (std::ostream &os) const

Private Attributes

aPoint m_p0
 the start point on the line
aVector m_v0
 the direction vector of the line

Detailed Description

template<typename aPoint, typename aVector>
class Gaudi::Math::Line< aPoint, aVector >

A very simple class to describe a 3D-line.

Based on line equation $ \vec{\mathbf{P}}\left(\mu\right) = \vec{\mathbf{P}}_0 + \mu \vec{\mathbf{V}}_0 $. where $ \vec{\mathbf{V}}_0$ is a direction vector of the line, $ \vec{\mathbf{V}}_0=\vec{\mathbf{P}}_1-\vec{\mathbf{P}}_1 $, $ \vec{\mathbf{P}}_1$ and $\vec{\mathbf{P}}_0 $ being two points on the line.

The class can be used as a very general abstraction for a 3D line. However, as there is only const access to the first point given in the constructor, this can take the meaning of the origin of a ray. The direction vector also only has const access. It can therefore be safely used to define the scale of steps along the line. Users requiring a normalised direction vector should construct the line using one.

Author:
Juan PALACIOS
Date:
2006-04-19

Definition at line 38 of file Line.h.


Member Typedef Documentation

template<typename aPoint, typename aVector>
typedef aPoint Gaudi::Math::Line< aPoint, aVector >::Point

Definition at line 41 of file Line.h.

template<typename aPoint, typename aVector>
typedef aVector Gaudi::Math::Line< aPoint, aVector >::Vector

Definition at line 42 of file Line.h.


Constructor & Destructor Documentation

template<typename aPoint, typename aVector>
Gaudi::Math::Line< aPoint, aVector >::Line (  )  [inline]

the default constructor

Definition at line 45 of file Line.h.

00045 {}

template<typename aPoint, typename aVector>
Gaudi::Math::Line< aPoint, aVector >::Line ( const aPoint &  p0,
const aVector &  v0 
) [inline]

the constructor from the point and direction vector

Definition at line 47 of file Line.h.

00047 : m_p0 ( p0 ) , m_v0 ( v0      ) {}

template<typename aPoint, typename aVector>
Gaudi::Math::Line< aPoint, aVector >::Line ( const aPoint &  p0,
const aPoint &  p1 
) [inline]

the constructor from two points:

Definition at line 49 of file Line.h.

00049 : m_p0 ( p0 ) , m_v0 ( p1 - p0 ) {}


Member Function Documentation

template<typename aPoint, typename aVector>
const aPoint& Gaudi::Math::Line< aPoint, aVector >::beginPoint (  )  const [inline]

Return the point of origin.

Definition at line 51 of file Line.h.

00051 { return m_p0 ; }

template<typename aPoint, typename aVector>
const aVector& Gaudi::Math::Line< aPoint, aVector >::direction (  )  const [inline]

Return the direction vector of the line.

Definition at line 53 of file Line.h.

00053 { return m_v0 ; }

template<typename aPoint, typename aVector>
aPoint Gaudi::Math::Line< aPoint, aVector >::position ( const double  mu  )  const [inline]

Return a point on the line tick direction vectors away from point of origin: $ \vec{\mathbf{P}}\left(\mu\right) = \vec{\mathbf{P}}_0 + \mu\vec{\mathbf{V}} $.

Definition at line 59 of file Line.h.

00060       { return beginPoint() + direction() * mu ; }

template<typename aPoint, typename aVector>
aPoint Gaudi::Math::Line< aPoint, aVector >::operator() ( const double  mu  )  const [inline]

Return a point on the line tick direction vectors away from point of origin: $ \vec{\mathbf{P}}\left(\mu\right) = \vec{\mathbf{P}}_0 + \mu\vec{\mathbf{V}} $.

Definition at line 66 of file Line.h.

00067       { return beginPoint() + direction() * mu ; }

template<typename aPoint, typename aVector>
std::ostream& Gaudi::Math::Line< aPoint, aVector >::fillStream ( std::ostream &  os  )  const [inline]

Definition at line 69 of file Line.h.

00070       {
00071         os << "\np0 (" 
00072            << m_p0.x() << " " << m_p0.y() << " " << m_p0.z()
00073            << ") direction (" 
00074            << m_v0.x()<< " " << m_v0.y() << " " << m_v0.z() << ")\n"
00075            << std::endl;
00076         return os;
00077       }


Member Data Documentation

template<typename aPoint, typename aVector>
aPoint Gaudi::Math::Line< aPoint, aVector >::m_p0 [private]

the start point on the line

Definition at line 80 of file Line.h.

template<typename aPoint, typename aVector>
aVector Gaudi::Math::Line< aPoint, aVector >::m_v0 [private]

the direction vector of the line

Definition at line 82 of file Line.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:02:58 2011 for LHCbMath by doxygen 1.4.7