CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
Normal3D.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: Normal3D.cc,v 1.3 2003/08/13 20:00:11 garren Exp $
3// ---------------------------------------------------------------------------
4
5#include "CLHEP/Geometry/defs.h"
6#include "CLHEP/Geometry/Normal3D.h"
7#include "CLHEP/Geometry/Transform3D.h"
8
9namespace HepGeom {
10 //--------------------------------------------------------------------------
11 Normal3D<float> &
13 double vx = x(), vy = y(), vz = z();
14 double xx = m.xx(), xy = m.xy(), xz = m.xz();
15 double yx = m.yx(), yy = m.yy(), yz = m.yz();
16 double zx = m.zx(), zy = m.zy(), zz = m.zz();
17 set((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
18 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
19 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
20 return *this;
21 }
22
23 //--------------------------------------------------------------------------
25 operator*(const Transform3D & m, const Normal3D<float> & v) {
26 double vx = v.x(), vy = v.y(), vz = v.z();
27 double xx = m.xx(), xy = m.xy(), xz = m.xz();
28 double yx = m.yx(), yy = m.yy(), yz = m.yz();
29 double zx = m.zx(), zy = m.zy(), zz = m.zz();
30 return Normal3D<float>
31 ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
32 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
33 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
34 }
35
36 //--------------------------------------------------------------------------
39 double vx = x(), vy = y(), vz = z();
40 double xx = m.xx(), xy = m.xy(), xz = m.xz();
41 double yx = m.yx(), yy = m.yy(), yz = m.yz();
42 double zx = m.zx(), zy = m.zy(), zz = m.zz();
43 set((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
44 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
45 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
46 return *this;
47 }
48
49 //--------------------------------------------------------------------------
51 operator*(const Transform3D & m, const Normal3D<double> & v) {
52 double vx = v.x(), vy = v.y(), vz = v.z();
53 double xx = m.xx(), xy = m.xy(), xz = m.xz();
54 double yx = m.yx(), yy = m.yy(), yz = m.yz();
55 double zx = m.zx(), zy = m.zy(), zz = m.zz();
56 return Normal3D<double>
57 ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
58 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
59 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
60 }
61} /* namespace HepGeom */
double zz() const
Definition: Transform3D.h:283
double yz() const
Definition: Transform3D.h:274
double xy() const
Definition: Transform3D.h:262
double zx() const
Definition: Transform3D.h:277
double yx() const
Definition: Transform3D.h:268
double zy() const
Definition: Transform3D.h:280
double xx() const
Definition: Transform3D.h:259
double yy() const
Definition: Transform3D.h:271
double xz() const
Definition: Transform3D.h:265
Normal3D< float > operator*(const Transform3D &m, const Normal3D< float > &v)
Definition: Normal3D.cc:25