Geant4
9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
Vector3D.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id:$
3
// ---------------------------------------------------------------------------
4
5
#include "
CLHEP/Geometry/Vector3D.h
"
6
#include "
CLHEP/Geometry/Transform3D.h
"
7
8
namespace
HepGeom
{
9
//--------------------------------------------------------------------------
10
Vector3D<float> &
11
Vector3D<float>::transform
(
const
Transform3D
& m) {
12
double
vx = x(), vy = y(), vz = z();
13
set(m.
xx
()*vx + m.
xy
()*vy + m.
xz
()*vz,
14
m.
yx
()*vx + m.
yy
()*vy + m.
yz
()*vz,
15
m.
zx
()*vx + m.
zy
()*vy + m.
zz
()*vz);
16
return
*
this
;
17
}
18
19
//--------------------------------------------------------------------------
20
Vector3D<float>
21
operator*
(
const
Transform3D
& m,
const
Vector3D<float>
& v) {
22
double
vx = v.
x
(), vy = v.
y
(), vz = v.
z
();
23
return
Vector3D<float>
24
(m.
xx
()*vx + m.
xy
()*vy + m.
xz
()*vz,
25
m.
yx
()*vx + m.
yy
()*vy + m.
yz
()*vz,
26
m.
zx
()*vx + m.
zy
()*vy + m.
zz
()*vz);
27
}
28
29
//--------------------------------------------------------------------------
30
Vector3D<double>
&
31
Vector3D<double>::transform
(
const
Transform3D
& m) {
32
double
vx = x(), vy = y(), vz = z();
33
set(m.
xx
()*vx + m.
xy
()*vy + m.
xz
()*vz,
34
m.
yx
()*vx + m.
yy
()*vy + m.
yz
()*vz,
35
m.
zx
()*vx + m.
zy
()*vy + m.
zz
()*vz);
36
return
*
this
;
37
}
38
39
//--------------------------------------------------------------------------
40
Vector3D<double>
41
operator*
(
const
Transform3D
& m,
const
Vector3D<double>
& v) {
42
double
vx = v.
x
(), vy = v.
y
(), vz = v.
z
();
43
return
Vector3D<double>
44
(m.
xx
()*vx + m.
xy
()*vy + m.
xz
()*vz,
45
m.
yx
()*vx + m.
yy
()*vy + m.
yz
()*vz,
46
m.
zx
()*vx + m.
zy
()*vy + m.
zz
()*vz);
47
}
48
}
/* namespace HepGeom */
Transform3D.h
Vector3D.h
HepGeom::BasicVector3D::x
T x() const
Definition:
BasicVector3D.h:141
HepGeom::BasicVector3D::y
T y() const
Definition:
BasicVector3D.h:144
HepGeom::BasicVector3D::z
T z() const
Definition:
BasicVector3D.h:147
HepGeom::Transform3D
Definition:
Transform3D.h:171
HepGeom::Transform3D::zz
double zz() const
Definition:
Transform3D.h:276
HepGeom::Transform3D::yz
double yz() const
Definition:
Transform3D.h:267
HepGeom::Transform3D::xy
double xy() const
Definition:
Transform3D.h:255
HepGeom::Transform3D::zx
double zx() const
Definition:
Transform3D.h:270
HepGeom::Transform3D::yx
double yx() const
Definition:
Transform3D.h:261
HepGeom::Transform3D::zy
double zy() const
Definition:
Transform3D.h:273
HepGeom::Transform3D::xx
double xx() const
Definition:
Transform3D.h:252
HepGeom::Transform3D::yy
double yy() const
Definition:
Transform3D.h:264
HepGeom::Transform3D::xz
double xz() const
Definition:
Transform3D.h:258
HepGeom::Vector3D
Definition:
Vector3D.h:34
HepGeom
Definition:
BasicVector3D.h:18
HepGeom::operator*
Normal3D< float > operator*(const Transform3D &m, const Normal3D< float > &v)
Definition:
Normal3D.cc:24
geant4-v9.6.0
source
externals
clhep
src
Vector3D.cc
Generated by
1.9.6