#include <stdlib.h>
#include <iomanip>
#include <cmath>
#include "wcpplib/geometry/vec.h"
#include "wcpplib/util/emul_new_stand.h"
#include <CLHEP/Random/RandomEngine.h>
#include "geometry/vec.ic"
Go to the source code of this file.
|
| macro_copy_body (absref_transmit) void absref_transmit |
|
vfloat | cos2vec (const vec &r1, const vec &r2) |
|
vfloat | ang2vec (const vec &r1, const vec &r2) |
|
vfloat | sin2vec (const vec &r1, const vec &r2) |
|
vec | project_to_plane (const vec &r, const vec &normal) |
|
vfloat | ang2projvec (const vec &r1, const vec &r2, const vec &normal) |
|
std::ostream & | operator<< (std::ostream &file, const vec &v) |
|
std::ostream & | operator<< (std::ostream &file, const vecReg &v) |
|
std::ostream & | operator<< (std::ostream &file, const basis &b) |
|
std::ostream & | operator<< (std::ostream &file, const basisReg &b) |
|
std::ostream & | operator<< (std::ostream &file, const point &p) |
|
std::ostream & | operator<< (std::ostream &file, const pointReg &b) |
|
std::ostream & | operator<< (std::ostream &file, const abssyscoor &f) |
|
std::ostream & | operator<< (std::ostream &file, const fixsyscoor &f) |
|
◆ ang2projvec()
Definition at line 212 of file vec.cpp.
212 {
214 "vfloat ang2projvec(const vec& r1, const vec& r2, const vec& normal)");
217 if (rt1 ==
dv0 || rt2 ==
dv0) {
219 return 0;
220 }
222 if (tang == 0) return tang;
224 int i = check_par(at, normal, 0.0001);
225
226
227
228 if (i == -1) return 2.0 * M_PI - tang;
229 return tang;
230}
vfloat ang2vec(const vec &r1, const vec &r2)
vec project_to_plane(const vec &r, const vec &normal)
#define pvecerror(string)
Referenced by Heed::polygon::check_point_in(), and Heed::splane::range().
◆ ang2vec()
Definition at line 165 of file vec.cpp.
165 {
166
167
168
171 if (cs > 0.707106781187 || cs < -0.707106781187) {
172
175 if (cs > 0.0)
177 else
178 return M_PI -
asin(sn);
179 }
181}
DoubleAc asin(const DoubleAc &f)
DoubleAc acos(const DoubleAc &f)
vfloat cos2vec(const vec &r1, const vec &r2)
vfloat sin2vec(const vec &r1, const vec &r2)
◆ cos2vec()
◆ macro_copy_body()
macro_copy_body |
( |
absref_transmit |
| ) |
|
Definition at line 33 of file vec.cpp.
37 {
38 if (l > 0) {
39 Ifile <<
"absref_transmit::print(l=" << l <<
") qaref=" << qaref
40 << " qaref_pointer=" << qaref_pointer
41 << " qaref_other=" << qaref_other << "\n";
42 file.flush();
43 }
44}
45
46absref* absref_transmit::get_other(
int ) {
return NULL; }
◆ operator<<() [1/8]
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const abssyscoor & |
f |
|
) |
| |
Definition at line 595 of file vec.cpp.
595 {
597 return file;
598}
virtual void print(std::ostream &file, int l) const
◆ operator<<() [2/8]
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const basis & |
b |
|
) |
| |
Definition at line 509 of file vec.cpp.
509 {
510 Ifile <<
"basis: name=" << b.
name <<
'\n';
512 int indnsave =
indn.
n;
526
527 return file;
528}
◆ operator<<() [3/8]
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const basisReg & |
b |
|
) |
| |
Definition at line 530 of file vec.cpp.
530 {
532 return file;
533}
◆ operator<<() [4/8]
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const fixsyscoor & |
f |
|
) |
| |
Definition at line 633 of file vec.cpp.
633 {
634 Ifile <<
"fixsyscoor:\n";
635 f.RegPassivePtr::print(file, 2);
636 f.abssyscoor::print(file, 2);
637 return file;
638}
◆ operator<<() [5/8]
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const point & |
p |
|
) |
| |
Definition at line 557 of file vec.cpp.
557 {
562 return file;
563}
◆ operator<<() [6/8]
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const pointReg & |
b |
|
) |
| |
Definition at line 565 of file vec.cpp.
565 {
567 return file;
568}
◆ operator<<() [7/8]
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const vec & |
v |
|
) |
| |
Definition at line 346 of file vec.cpp.
346 {
347 Ifile <<
"vector=" << std::setw(13) << v.
x << std::setw(13) << v.
y
348 << std::setw(13) << v.
z;
349 file << '\n';
350 file.flush();
351 return file;
352}
◆ operator<<() [8/8]
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const vecReg & |
v |
|
) |
| |
Definition at line 359 of file vec.cpp.
359 {
361 return file;
362}
◆ project_to_plane()
vec project_to_plane |
( |
const vec & |
r, |
|
|
const vec & |
normal |
|
) |
| |
◆ sin2vec()
Definition at line 183 of file vec.cpp.
183 {
184
185 pvecerror(
"vfloat sin2vec(const vec& r1, const vec& r2)");
188 if (lr1 == 0 || lr2 == 0) {
190 return 0;
191 }
192 vfloat sn = length(r1 || r2);
193 sn = sn * sn;
194 sn =
sqrt(sn / (lr1 * lr2));
195
196 return sn;
197
198}
Referenced by Heed::straight::distance().
◆ dex
vec dex(1, 0, 0) |
( |
1 |
, |
|
|
0 |
, |
|
|
0 |
|
|
) |
| |
◆ dey
vec dey(0, 1, 0) |
( |
0 |
, |
|
|
1 |
, |
|
|
0 |
|
|
) |
| |
◆ dez
vec dez(0, 0, 1) |
( |
0 |
, |
|
|
0 |
, |
|
|
1 |
|
|
) |
| |
◆ dv0
vec dv0(0, 0, 0) |
( |
0 |
, |
|
|
0 |
, |
|
|
0 |
|
|
) |
| |
Referenced by gparticle::calc_step_to_bord(), Heed::box::check_point_inside(), Heed::splane::check_point_inside(), Heed::straight::cross(), Heed::mparticle::curvature(), gparticle::gparticle(), Heed::mparticle::mparticle(), Heed::mparticle::new_speed(), gparticle::step(), Heed::mparticle::step(), and trajestep::trajestep().
◆ random_engine
HepRandomEngine& random_engine |
|
extern |
◆ vecerror
Definition at line 31 of file vec.cpp.
Referenced by Heed::spquadr::apos(), basis::basis(), Heed::mparticle::check_consistency(), Heed::circumf::cross(), Heed::polyline::cross(), Heed::polygon::cross(), Heed::plane::cross(), Heed::straight::cross(), Heed::mparticle::new_speed(), Heed::spquadr::perpos(), Heed::HeedDeltaElectron::physics_after_new_speed(), Heed::plane::plane(), Heed::polygon::polygon(), Heed::polygon::range(), Heed::splane::range(), and Heed::straight::vecdistance().