10 #include "CLHEP/Geometry/Point3D.h"
11 #include "CLHEP/Geometry/Normal3D.h"
12 #include "CLHEP/Geometry/Plane3D.h"
17 HepGeom::Point3D<double>
pp;
18 HepGeom::Vector3D<double>
uu;
22 HepLine3D(
const HepGeom::Point3D<double>&
p,
const HepGeom::Vector3D<double>&
v,
double sml = 1.
e-10)
25 HepLine3D(
const HepGeom::Point3D<double>&
p1,
const HepGeom::Point3D<double>&
p2,
double sml = 1.
e-10)
48 const HepGeom::Point3D<double>&
pt()
const {
return pp; }
50 const HepGeom::Vector3D<double>&
uv()
const {
return uu; }
52 HepGeom::Point3D<double>
point(
const HepGeom::Plane3D<double>& pl,
bool& parallel)
const {
53 const double num(-pl.d() - pl.a() *
pp.x() - pl.b() *
pp.y() - pl.c() *
pp.z());
54 const double den(pl.a() *
uu.x() + pl.b() *
uu.y() + pl.c() *
uu.z());
56 parallel = (
eps > fabs(
num)) || (
eps > fabs(den));
58 return (parallel ?
pp : HepGeom::Point3D<double>(
pp +
uu * (
num / den)));
61 HepGeom::Point3D<double>
point(
const HepGeom::Point3D<double>&
q)
const {
62 return (
pp + ((
q.x() -
pp.x()) *
uu.x() + (
q.y() -
pp.y()) *
uu.y() + (
q.z() -
pp.z()) *
uu.z()) *
uu);
65 double dist2(
const HepGeom::Point3D<double>&
q)
const {
return (
q -
point(
q)).mag2(); }
66 double dist(
const HepGeom::Point3D<double>&
q)
const {
return (
q -
point(
q)).mag(); }