CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
LineXY Class Reference

#include <RoadSearchCircleSeed.h>

Public Member Functions

 LineXY (GlobalPoint point1, GlobalPoint point2)
 
double Phi () const
 
 ~LineXY ()
 

Private Attributes

double theX_
 
double theY_
 

Detailed Description

Definition at line 136 of file RoadSearchCircleSeed.h.

Constructor & Destructor Documentation

LineXY::LineXY ( GlobalPoint  point1,
GlobalPoint  point2 
)

Definition at line 470 of file RoadSearchCircleSeed.cc.

References PV3DBase< T, PVType, FrameType >::perp(), theX_, theY_, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

471 {
472  theX_ = std::fabs(point1.x()-point2.x());
473  theY_ = std::fabs(point1.y()-point2.y());
474  //If the line is pointing backwards in x
475  if ((point1.perp() >= point2.perp() &&
476  point1.x() < point2.x()) ||
477  (point2.perp() >= point1.perp() &&
478  point2.x() < point1.x()))
479  {
480  theX_ = -1.*theX_;
481  }
482  //If the line is pointing backwards in y
483  if ((point1.perp() >= point2.perp() &&
484  point1.y() < point2.y()) ||
485  (point2.perp() >= point1.perp() &&
486  point2.y() < point1.y()))
487  {
488  theY_ = -1.*theY_;
489  }
490 }
T perp() const
Definition: PV3DBase.h:71
T y() const
Definition: PV3DBase.h:62
T x() const
Definition: PV3DBase.h:61
LineXY::~LineXY ( )

Definition at line 495 of file RoadSearchCircleSeed.cc.

496 { }

Member Function Documentation

double LineXY::Phi ( ) const
inline

Definition at line 141 of file RoadSearchCircleSeed.h.

References theX_, and theY_.

141 { return atan2(theY_,theX_); }

Member Data Documentation

double LineXY::theX_
private

Definition at line 144 of file RoadSearchCircleSeed.h.

Referenced by LineXY(), and Phi().

double LineXY::theY_
private

Definition at line 145 of file RoadSearchCircleSeed.h.

Referenced by LineXY(), and Phi().