00001
00002
00003
00004
00005 #include "CLHEP/Geometry/Vector3D.h"
00006 #include "CLHEP/Geometry/Transform3D.h"
00007
00008 namespace HepGeom {
00009
00010 Vector3D<float> &
00011 Vector3D<float>::transform(const Transform3D & m) {
00012 double vx = x(), vy = y(), vz = z();
00013 set(m.xx()*vx + m.xy()*vy + m.xz()*vz,
00014 m.yx()*vx + m.yy()*vy + m.yz()*vz,
00015 m.zx()*vx + m.zy()*vy + m.zz()*vz);
00016 return *this;
00017 }
00018
00019
00020 Vector3D<float>
00021 operator*(const Transform3D & m, const Vector3D<float> & v) {
00022 double vx = v.x(), vy = v.y(), vz = v.z();
00023 return Vector3D<float>
00024 (m.xx()*vx + m.xy()*vy + m.xz()*vz,
00025 m.yx()*vx + m.yy()*vy + m.yz()*vz,
00026 m.zx()*vx + m.zy()*vy + m.zz()*vz);
00027 }
00028
00029
00030 Vector3D<double> &
00031 Vector3D<double>::transform(const Transform3D & m) {
00032 double vx = x(), vy = y(), vz = z();
00033 set(m.xx()*vx + m.xy()*vy + m.xz()*vz,
00034 m.yx()*vx + m.yy()*vy + m.yz()*vz,
00035 m.zx()*vx + m.zy()*vy + m.zz()*vz);
00036 return *this;
00037 }
00038
00039
00040 Vector3D<double>
00041 operator*(const Transform3D & m, const Vector3D<double> & v) {
00042 double vx = v.x(), vy = v.y(), vz = v.z();
00043 return Vector3D<double>
00044 (m.xx()*vx + m.xy()*vy + m.xz()*vz,
00045 m.yx()*vx + m.yy()*vy + m.yz()*vz,
00046 m.zx()*vx + m.zy()*vy + m.zz()*vz);
00047 }
00048 }