00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef HEP_POINT3D_H
00014 #define HEP_POINT3D_H
00015
00016 #include "CLHEP/config/CLHEP.h"
00017 #include "CLHEP/Geometry/BasicVector3D.h"
00018
00019 class HepTransform3D;
00020
00031 class HepPoint3D : public BasicVector3D {
00032 public:
00034 HepPoint3D() {}
00035
00037 HepPoint3D(double x, double y, double z) : BasicVector3D(x,y,z) {}
00038
00040 HepPoint3D(const BasicVector3D & v) : BasicVector3D(v) {}
00041
00047 HepPoint3D(const Hep3Vector & v) : BasicVector3D(v) {}
00048
00050 ~HepPoint3D() {}
00051
00053 HepPoint3D & operator=(const HepPoint3D & v) {
00054 set(v.x(),v.y(),v.z()); return *this;
00055 }
00056
00059 HepPoint3D & operator=(const BasicVector3D & v) {
00060 set(v.x(),v.y(),v.z()); return *this;
00061 }
00062
00064 double distance2() const { return mag2(); }
00065
00067 double distance2(const HepPoint3D & p) const {
00068 double delx = p.x()-x(), dely = p.y()-y(), delz = p.z()-z();
00069 return delx*delx + dely*dely + delz*delz;
00070 }
00071
00073 double distance() const { return sqrt(distance2()); }
00074
00076 double distance(const HepPoint3D & p) const { return sqrt(distance2(p)); }
00077
00079 HepPoint3D & transform(const HepTransform3D &m);
00080 };
00081
00082 #include "CLHEP/Geometry/Transform3D.h"
00083
00084 inline HepPoint3D & HepPoint3D::transform(const HepTransform3D & m) {
00085 return *this = m * (*this);
00086 }
00087
00088 #endif