10#include "CLHEP/Vector/defs.h"
11#include "CLHEP/Vector/TwoVector.h"
12#include "CLHEP/Vector/ZMxpv.h"
13#include "CLHEP/Vector/ThreeVector.h"
24 double oldTolerance (tolerance);
36 "Hep2Vector::operator(): bad index"));
50 "Hep2Vector::operator() : bad index"));
56 double s1 = std::sin(angler);
57 double c = std::cos(angler);
65 ZMthrowA(ZMxpvInfiniteVector(
"Division of Hep2Vector by zero"));
71 os <<
"(" << q.
x() <<
", " << q.
y() <<
")";
76 double & x,
double & y );
92 }
else if ( dy < v.dy ) {
94 }
else if ( dx > v.dx ) {
96 }
else if ( dx < v.dx ) {
118 double limit =
dot(p)*epsilon*epsilon;
119 return ( (*
this - p).
mag2() <= limit );
123 double d = (*
this - p).
mag2();
125 if ( (pdp > 0) && (d < pdp) ) {
126 return std::sqrt (d/pdp);
127 }
else if ( (pdp == 0) && (d == 0) ) {
137 double v1v2 = std::fabs(
dot(v));
140 return ( (
mag2() == 0) && (v.
mag2() == 0) ) ? 0 : 1;
142 double abscross = std::fabs ( dx * v.
y() - dy - v.
x() );
143 if ( abscross >= v1v2 ) {
146 return abscross/v1v2;
151 double epsilon)
const {
154 double v1v2 = std::fabs(
dot(v));
157 return ( (
mag2() == 0) && (v.
mag2() == 0) );
159 double abscross = std::fabs ( dx * v.
y() - dy - v.
x() );
160 return ( abscross <= epsilon * v1v2 );
166 double v1v2 = std::fabs(
dot(v));
170 double abscross = std::fabs ( dx * v.
y() - dy - v.
x() );
171 if ( v1v2 >= abscross ) {
174 return v1v2/abscross;
179 double epsilon)
const {
182 double v1v2 = std::fabs(
dot(v));
183 double abscross = std::fabs ( dx * v.
y() - dy - v.
x() );
184 return ( v1v2 <= epsilon * abscross );
bool isOrthogonal(const Hep2Vector &p, double epsilon=tolerance) const
bool operator<=(const Hep2Vector &v) const
double dot(const Hep2Vector &p) const
double howOrthogonal(const Hep2Vector &p) const
bool isNear(const Hep2Vector &p, double epsilon=tolerance) const
double howNear(const Hep2Vector &p) const
double howParallel(const Hep2Vector &p) const
int compare(const Hep2Vector &v) const
bool isParallel(const Hep2Vector &p, double epsilon=tolerance) const
bool operator>(const Hep2Vector &v) const
static const int ZMpvToleranceTicks
void set(double x, double y)
double operator()(int i) const
bool operator>=(const Hep2Vector &v) const
static double setTolerance(double tol)
bool operator<(const Hep2Vector &v) const
void ZMinput2doubles(std::istream &is, const char *type, double &x, double &y)
std::istream & operator>>(std::istream &is, HepRandom &dist)
std::ostream & operator<<(std::ostream &s, const HepDiagMatrix &q)
HepDiagMatrix operator/(const HepDiagMatrix &hm1, double t)