16#ifdef TRKRECO_DEBUG_DETAIL
23#include "CLHEP/Geometry/Vector3D.h"
24#ifndef ENABLE_BACKWARDS_COMPATIBILITY
27#ifndef CLHEP_POINT3D_H
28# include "CLHEP/Geometry/Point3D.h"
30#ifndef ENABLE_BACKWARDS_COMPATIBILITY
50 double x(
void )
const;
51 double y(
void )
const;
52 double mag(
void )
const;
54 double phi(
void )
const;
77#ifdef TPOINT2D_NO_INLINE
81# define TPOINT2D_INLINE_DEFINE_HERE
83#ifdef TPOINT2D_INLINE_DEFINE_HERE
85inline double TPoint2D::x(
void )
const {
return _p[0]; }
87inline double TPoint2D::y(
void )
const {
return _p[1]; }
89inline double TPoint2D::x(
double a ) {
return _p[0] = a; }
91inline double TPoint2D::y(
double a ) {
return _p[1] = a; }
93inline double TPoint2D::mag(
void )
const {
return sqrt( _p[0] * _p[0] + _p[1] * _p[1] ); }
95inline double TPoint2D::mag2(
void )
const {
return _p[0] * _p[0] + _p[1] * _p[1]; }
98 if ( _p[0] == 0.0 && _p[1] == 0.0 )
return 0.;
99 double a = atan2( _p[1], _p[0] );
100 if ( a > 0 )
return a;
101 return a + 2. *
M_PI;
105 return _p[0] * a.
x() + _p[1] * a.
y();
109 return _p[0] * a.
y() - a.
x() * _p[1];
113 return TPoint2D( _p[0] + a.
x(), _p[1] + a.
y() );
117 return TPoint2D( _p[0] - a.
x(), _p[1] - a.
y() );
123 if ( a.
x() == _p[0] && a.
y() == _p[1] )
return true;
128 double sum2 = _p[0] * _p[0] + _p[1] * _p[1];
129 if ( sum2 == 0. )
return TPoint2D( 0., 0. );
130 double sum = sqrt( sum2 );
131 return TPoint2D( _p[0] / sum, _p[1] / sum );
HepGeom::Vector3D< double > HepVector3D
HepGeom::Point3D< double > HepPoint3D
std::ostream & operator<<(std::ostream &, const TPoint2D &)
HepGeom::Point3D< double > HepPoint3D
HepGeom::Vector3D< double > HepVector3D
A class to represent a point in 2D.
TPoint2D operator-() const
double dot(const TPoint2D &) const
double cross(const TPoint2D &) const
bool operator==(const TPoint2D &) const
TPoint2D(const HepPoint3D &)
virtual ~TPoint2D()
Destructor.
TPoint2D operator-(const TPoint2D &) const
TPoint2D(const HepVector3D &)
TPoint2D unit(void) const
TPoint2D operator+(const TPoint2D &) const