Geant4  10.01.p03
UVector2 Class Reference

#include <UVector2.hh>

Public Types

enum  { X = 0, Y = 1, NUM_COORDINATES = 2, SIZE = NUM_COORDINATES }
 
enum  { ZMpvToleranceTicks = 100 }
 

Public Member Functions

 UVector2 (double x=0.0, double y=0.0)
 
 UVector2 (const UVector2 &p)
 
 UVector2 (const UVector3 &s)
 
 ~UVector2 ()
 
double operator() (int i) const
 
double operator[] (int i) const
 
double & operator() (int i)
 
double & operator[] (int i)
 
void setX (double x)
 
void setY (double y)
 
void set (double x, double y)
 
double phi () const
 
double mag2 () const
 
double mag () const
 
double r () const
 
void setPhi (double phi)
 
void setMag (double r)
 
void setR (double r)
 
void setPolar (double r, double phi)
 
UVector2operator= (const UVector2 &p)
 
bool operator== (const UVector2 &v) const
 
bool operator!= (const UVector2 &v) const
 
int compare (const UVector2 &v) const
 
bool operator> (const UVector2 &v) const
 
bool operator< (const UVector2 &v) const
 
bool operator>= (const UVector2 &v) const
 
bool operator<= (const UVector2 &v) const
 
double howNear (const UVector2 &p) const
 
bool isNear (const UVector2 &p, double epsilon=tolerance) const
 
double howParallel (const UVector2 &p) const
 
bool isParallel (const UVector2 &p, double epsilon=tolerance) const
 
double howOrthogonal (const UVector2 &p) const
 
bool isOrthogonal (const UVector2 &p, double epsilon=tolerance) const
 
UVector2operator+= (const UVector2 &p)
 
UVector2operator-= (const UVector2 &p)
 
UVector2 operator- () const
 
UVector2operator*= (double a)
 
UVector2 unit () const
 
UVector2 orthogonal () const
 
double dot (const UVector2 &p) const
 
double angle (const UVector2 &) const
 
void rotate (double)
 
 operator UVector3 () const
 

Static Public Member Functions

static double getTolerance ()
 
static double setTolerance (double tol)
 

Public Attributes

double x
 
double y
 

Static Private Attributes

static double tolerance = UVector2::ZMpvToleranceTicks * 2.22045e-16
 

Friends

std::ostream & operator<< (std::ostream &, const UVector2 &)
 
double operator* (const UVector2 &a, const UVector2 &b)
 
UVector2 operator* (const UVector2 &p, double a)
 
UVector2 operator* (double a, const UVector2 &p)
 
UVector2 operator/ (const UVector2 &p, double a)
 
UVector2 operator+ (const UVector2 &a, const UVector2 &b)
 
UVector2 operator- (const UVector2 &a, const UVector2 &b)
 

Detailed Description

Author

Definition at line 45 of file UVector2.hh.

Member Enumeration Documentation

anonymous enum
Enumerator
NUM_COORDINATES 
SIZE 

Definition at line 50 of file UVector2.hh.

anonymous enum
Enumerator
ZMpvToleranceTicks 

Definition at line 193 of file UVector2.hh.

Constructor & Destructor Documentation

UVector2::UVector2 ( double  x = 0.0,
double  y = 0.0 
)
inline

Definition at line 220 of file UVector2.hh.

Referenced by operator-(), orthogonal(), and unit().

+ Here is the caller graph for this function:

UVector2::UVector2 ( const UVector2 p)
inline

Definition at line 251 of file UVector2.hh.

UVector2::UVector2 ( const UVector3 s)
inlineexplicit

Definition at line 223 of file UVector2.hh.

UVector2::~UVector2 ( )
inline

Definition at line 254 of file UVector2.hh.

Member Function Documentation

double UVector2::angle ( const UVector2 q) const
inline

Definition at line 345 of file UVector2.hh.

References dot(), and mag2().

+ Here is the call graph for this function:

int UVector2::compare ( const UVector2 v) const

Definition at line 105 of file UVector2.cc.

References x, and y.

Referenced by operator<(), operator<=(), operator>(), and operator>=().

+ Here is the caller graph for this function:

double UVector2::dot ( const UVector2 p) const
inline

Definition at line 300 of file UVector2.hh.

References x, and y.

Referenced by angle(), howNear(), howOrthogonal(), howParallel(), UTessellatedGeometryAlgorithms::IntersectLineAndLineSegment2D(), isNear(), isOrthogonal(), isParallel(), and operator*().

+ Here is the caller graph for this function:

double UVector2::getTolerance ( )
inlinestatic

Definition at line 401 of file UVector2.hh.

References tolerance.

double UVector2::howNear ( const UVector2 p) const

Definition at line 153 of file UVector2.cc.

References dot(), and mag2().

+ Here is the call graph for this function:

double UVector2::howOrthogonal ( const UVector2 p) const

Definition at line 207 of file UVector2.cc.

References dot(), x, and y.

+ Here is the call graph for this function:

double UVector2::howParallel ( const UVector2 p) const

Definition at line 171 of file UVector2.cc.

References dot(), mag2(), x, and y.

+ Here is the call graph for this function:

bool UVector2::isNear ( const UVector2 p,
double  epsilon = tolerance 
) const

Definition at line 147 of file UVector2.cc.

References dot(), and mag2().

+ Here is the call graph for this function:

bool UVector2::isOrthogonal ( const UVector2 p,
double  epsilon = tolerance 
) const

Definition at line 227 of file UVector2.cc.

References dot(), x, and y.

+ Here is the call graph for this function:

bool UVector2::isParallel ( const UVector2 p,
double  epsilon = tolerance 
) const

Definition at line 192 of file UVector2.cc.

References dot(), mag2(), x, and y.

+ Here is the call graph for this function:

double UVector2::mag ( ) const
inline

Definition at line 310 of file UVector2.hh.

References mag2().

Referenced by UTriangularFacet::Intersect(), and setPhi().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double UVector2::mag2 ( ) const
inline

Definition at line 305 of file UVector2.hh.

References x, and y.

Referenced by angle(), howNear(), howParallel(), UTessellatedGeometryAlgorithms::IntersectLineAndLineSegment2D(), isNear(), isParallel(), mag(), r(), and unit().

+ Here is the caller graph for this function:

UVector2::operator UVector3 ( ) const

Definition at line 100 of file UVector2.cc.

bool UVector2::operator!= ( const UVector2 v) const
inline

Definition at line 269 of file UVector2.hh.

References x, and y.

double UVector2::operator() ( int  i) const

Definition at line 31 of file UVector2.cc.

References x, and y.

Referenced by operator[]().

+ Here is the caller graph for this function:

double & UVector2::operator() ( int  i)

Definition at line 48 of file UVector2.cc.

References X, x, Y, and y.

UVector2 & UVector2::operator*= ( double  a)
inline

Definition at line 293 of file UVector2.hh.

References a, x, and y.

UVector2 & UVector2::operator+= ( const UVector2 p)
inline

Definition at line 274 of file UVector2.hh.

References x, and y.

UVector2 UVector2::operator- ( ) const
inline

Definition at line 288 of file UVector2.hh.

References UVector2(), x, and y.

+ Here is the call graph for this function:

UVector2 & UVector2::operator-= ( const UVector2 p)
inline

Definition at line 281 of file UVector2.hh.

References x, and y.

bool UVector2::operator< ( const UVector2 v) const

Definition at line 134 of file UVector2.cc.

References compare().

+ Here is the call graph for this function:

bool UVector2::operator<= ( const UVector2 v) const

Definition at line 142 of file UVector2.cc.

References compare().

+ Here is the call graph for this function:

UVector2 & UVector2::operator= ( const UVector2 p)
inline

Definition at line 256 of file UVector2.hh.

References x, and y.

bool UVector2::operator== ( const UVector2 v) const
inline

Definition at line 264 of file UVector2.hh.

References x, and y.

bool UVector2::operator> ( const UVector2 v) const

Definition at line 130 of file UVector2.cc.

References compare().

+ Here is the call graph for this function:

bool UVector2::operator>= ( const UVector2 v) const

Definition at line 138 of file UVector2.cc.

References compare().

+ Here is the call graph for this function:

double UVector2::operator[] ( int  i) const
inline

Definition at line 246 of file UVector2.hh.

References operator()().

+ Here is the call graph for this function:

double & UVector2::operator[] ( int  i)
inline

Definition at line 242 of file UVector2.hh.

References operator()().

+ Here is the call graph for this function:

UVector2 UVector2::orthogonal ( ) const
inline

Definition at line 327 of file UVector2.hh.

References UVector2(), x, and y.

+ Here is the call graph for this function:

double UVector2::phi ( ) const
inline

Definition at line 340 of file UVector2.hh.

References x, and y.

Referenced by UExtrudedSolid::IsConvex(), and setMag().

+ Here is the caller graph for this function:

double UVector2::r ( ) const
inline

Definition at line 315 of file UVector2.hh.

References mag2().

+ Here is the call graph for this function:

void UVector2::rotate ( double  angler)

Definition at line 64 of file UVector2.cc.

References s, x, and y.

void UVector2::set ( double  x,
double  y 
)
inline

Definition at line 236 of file UVector2.hh.

References x, and y.

void UVector2::setMag ( double  r)
inline

Definition at line 351 of file UVector2.hh.

References phi(), setX(), and setY().

Referenced by setR().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void UVector2::setPhi ( double  phi)
inline

Definition at line 363 of file UVector2.hh.

References mag(), setX(), and setY().

+ Here is the call graph for this function:

void UVector2::setPolar ( double  r,
double  phi 
)
inline

Definition at line 370 of file UVector2.hh.

References setX(), and setY().

+ Here is the call graph for this function:

void UVector2::setR ( double  r)
inline

Definition at line 358 of file UVector2.hh.

References setMag().

+ Here is the call graph for this function:

double UVector2::setTolerance ( double  tol)
static

Definition at line 23 of file UVector2.cc.

References tolerance.

void UVector2::setX ( double  x)
inline

Definition at line 226 of file UVector2.hh.

References x.

Referenced by setMag(), setPhi(), and setPolar().

+ Here is the caller graph for this function:

void UVector2::setY ( double  y)
inline

Definition at line 231 of file UVector2.hh.

References y.

Referenced by setMag(), setPhi(), and setPolar().

+ Here is the caller graph for this function:

UVector2 UVector2::unit ( ) const
inline

Definition at line 320 of file UVector2.hh.

References mag2(), and UVector2().

+ Here is the call graph for this function:

Friends And Related Function Documentation

double operator* ( const UVector2 a,
const UVector2 b 
)
friend

Definition at line 396 of file UVector2.hh.

UVector2 operator* ( const UVector2 p,
double  a 
)
friend

Definition at line 386 of file UVector2.hh.

UVector2 operator* ( double  a,
const UVector2 p 
)
friend

Definition at line 391 of file UVector2.hh.

UVector2 operator+ ( const UVector2 a,
const UVector2 b 
)
friend

Definition at line 376 of file UVector2.hh.

UVector2 operator- ( const UVector2 a,
const UVector2 b 
)
friend

Definition at line 381 of file UVector2.hh.

UVector2 operator/ ( const UVector2 p,
double  a 
)
friend

Definition at line 73 of file UVector2.cc.

std::ostream& operator<< ( std::ostream &  os,
const UVector2 q 
)
friend

Definition at line 82 of file UVector2.cc.

Member Data Documentation

double UVector2::tolerance = UVector2::ZMpvToleranceTicks * 2.22045e-16
staticprivate

Definition at line 201 of file UVector2.hh.

Referenced by getTolerance(), and setTolerance().


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