Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
Normal3D.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id:$
3// ---------------------------------------------------------------------------
4
7
8namespace 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 //--------------------------------------------------------------------------
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 zz() const
Definition: Transform3D.h:276
double yz() const
Definition: Transform3D.h:267
double xy() const
Definition: Transform3D.h:255
double zx() const
Definition: Transform3D.h:270
double yx() const
Definition: Transform3D.h:261
double zy() const
Definition: Transform3D.h:273
double xx() const
Definition: Transform3D.h:252
double yy() const
Definition: Transform3D.h:264
double xz() const
Definition: Transform3D.h:258
Normal3D< float > operator*(const Transform3D &m, const Normal3D< float > &v)
Definition: Normal3D.cc:24