Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Normal3D.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id:$
3 // ---------------------------------------------------------------------------
4 
7 
8 namespace HepGeom {
9  //--------------------------------------------------------------------------
10  Normal3D<float> &
12  double vx = x(), vy = y(), vz = z();
13  double xx = m.xx(), xy = m.xy(), xz = m.xz();
14  double yx = m.yx(), yy = m.yy(), yz = m.yz();
15  double zx = m.zx(), zy = m.zy(), zz = m.zz();
16  set((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
17  (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
18  (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
19  return *this;
20  }
21 
22  //--------------------------------------------------------------------------
24  operator*(const Transform3D & m, const Normal3D<float> & v) {
25  double vx = v.x(), vy = v.y(), vz = v.z();
26  double xx = m.xx(), xy = m.xy(), xz = m.xz();
27  double yx = m.yx(), yy = m.yy(), yz = m.yz();
28  double zx = m.zx(), zy = m.zy(), zz = m.zz();
29  return Normal3D<float>
30  ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
31  (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
32  (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
33  }
34 
35  //--------------------------------------------------------------------------
36  Normal3D<double> &
38  double vx = x(), vy = y(), vz = z();
39  double xx = m.xx(), xy = m.xy(), xz = m.xz();
40  double yx = m.yx(), yy = m.yy(), yz = m.yz();
41  double zx = m.zx(), zy = m.zy(), zz = m.zz();
42  set((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
43  (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
44  (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
45  return *this;
46  }
47 
48  //--------------------------------------------------------------------------
50  operator*(const Transform3D & m, const Normal3D<double> & v) {
51  double vx = v.x(), vy = v.y(), vz = v.z();
52  double xx = m.xx(), xy = m.xy(), xz = m.xz();
53  double yx = m.yx(), yy = m.yy(), yz = m.yz();
54  double zx = m.zx(), zy = m.zy(), zz = m.zz();
55  return Normal3D<double>
56  ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
57  (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
58  (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
59  }
60 } /* namespace HepGeom */
double yy() const
Definition: Transform3D.h:264
void set(T x1, T y1, T z1)
double yx() const
Definition: Transform3D.h:261
double zz() const
Definition: Transform3D.h:276
double xz() const
Definition: Transform3D.h:258
static constexpr double m
Definition: G4SIunits.hh:129
double xy() const
Definition: Transform3D.h:255
double yz() const
Definition: Transform3D.h:267
double xx() const
Definition: Transform3D.h:252
Normal3D< float > operator*(const Transform3D &m, const Normal3D< float > &v)
Definition: Normal3D.cc:24
double zy() const
Definition: Transform3D.h:273
double zx() const
Definition: Transform3D.h:270