Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
vec.h
Go to the documentation of this file.
1#ifndef VEC_H
2#define VEC_H
3/*
4The base geometry file, determines class for geometrical conversions absref,
5vectors (vec), basises, points, and systems of coordinates.
6Points differ from vectors in the conversions.
7Point is a vector denoting the position with respoct to the center of
8coordinates. The vector is notation of direction. The vector is not
9changed at parallel translations of basis or system of coordinates,
10whereas the point is changed. Other explanations in my preprint
11"SpaceMetricLib, geometrical class library for detector modeling in HEP"
12
13
14Copyright (c) 2000 Igor B. Smirnov
15
16The file can be used, copied, modified, and distributed
17according to the terms of GNU Lesser General Public License version 2.1
18as published by the Free Software Foundation,
19and provided that the above copyright notice, this permission notice,
20and notices about any modifications of the original text
21appear in all copies and in supporting documentation.
22The file is provided "as is" without express or implied warranty.
23*/
24
28#include <string.h>
29#include "wcpplib/util/String.h"
30#ifdef BORLANDC
31// The following macro provides debigging online.
32// It stops program before it terminates
33#define pvecerror \
34 { \
35 if (vecerror != 0) { \
36 cerr << "vecerror is not zero(put any key)\n"; \
37 char c; \
38 cin >> c; \
39 exit(1); \
40 } \
41 }
42#define pvecerrorp \
43 { \
44 if (vecerror != 0) { \
45 cerr << "vecerror is not zero(put any key)\n"; \
46 char c; \
47 cin >> c; \
48 exit(1); \
49 } \
50 }
51#else
52#define pvecerror(string) \
53 mfunname(string); \
54 if (vecerror != 0) { \
55 mcerr << "vecerror is not zero, program is terminated\n" \
56 << " function detected error is " << string << '\n'; \
57 spexit(mcerr); \
58 }
59#define pvecerrorp(string) \
60 mfunnamep(string); \
61 if (vecerror != 0) { \
62 mcerr << "vecerror is not zero, program is terminated\n" \
63 << " function detected error is " << string << '\n'; \
64 spexit(mcerr); \
65 }
66#endif
67// pvecerror is put after first line of function.
68// It makes up stack of functions names if FUNNAMESTACK is defined.
69// To work correctly stackline(string); should not be in any additional {}
70
71//#define pqcross 10
72
74/* Introduces type vfloat which is used throughout the geometrical calculations
75instead of double. 'double' is meant to be replacable by 'float' for
76speeding up, but no consistent research was made to check that it really
77works in this way. So now vfloat is synonym of double.
78*/
79
80//#include "wcpplib/memory/macrmem.h"
81/*
82It is to invoke special memory allocator for debug.
83*/
84
85// The following is removed because of passing to fortran generator RANLUX
86//#ifndef RandEngine_h
87//#include "CLHEP/Random/RandEngine.h"
88//#endif
89//extern RandEngine RandEng;
90//#ifdef USE_SRANLUX
91//#include "wcpplib/random/ranluxint.h" // used only in .c
92//#else
93//#include <CLHEP/Random/RandomEngine.h>
94//extern HepRandomEngine& random_engine;
95// I will comment it off in order to compile all files
96// which include this files (quite a lot!) without need to set
97// USE_SRANLUX or path to CLHEP.
98// So I put this extern to vec.c
99
100//#endif
101
102extern int vecerror;
103
104class vec;
105class basis; //It is ortogonal basis
106class abssyscoor;
107class point;
108
109class absref_transmit;
110
111// **** absref ****
112/*
113Abstract reference.
114Basis class for any geometrical vector object.
115Used for arranging of shift, turn and shange of coordinate system of
116vector objects. Four functions down(), up(), turn(), and shift() do that
117by calling of the same functions for any vector objects which are parts
118of this class. Address of parts lets known by virtual function get_components()
119which is reloaded in any derivative class.
120Class vec represents 3-vectors and
121reloads the functions down(), up(), turn() with proper functions
122manipulating with 3-vectors.
123Function shift() is also reloaded and does nothing for 3-vector vec,
124since it is assumed that 3-vector is characteristic of direction only,
125not point in space. We can not shift direction.
126For this reason, class point representing point in space
127reloads functions down and up again, and, of course, reloads shift.
128To make proper shift at switch to coordinate system with shifted center
129the point::down() and point::up() functions apply point::shift() function
130after or before vec::down() and vec::up().
131*/
132
133class absref // referencing not positioned abstract object
134 {
135 public:
136 // destructor
137 virtual ~absref() {}
138 // convert numbering representation of object to basical system of fasc
139 virtual void down(const abssyscoor* fasc);
140 // convert numbering representation of objects to new system
141 virtual void up(const abssyscoor* fasc);
142 // turn around axis doing via center of coordinate system along dir.
143 virtual void turn(const vec& dir, vfloat angle);
144 virtual void shift(const vec& dir);
145
146 private:
147 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
148 /*
149 virtual void Garef( // members of class:
150 int& qaref , // number of vector objects members of class
151 absref absref::**&aref , // reference to address of array
152 // containing their relative addresses
153 // as class members
154
155 //free memory, their relative addresses are not available:
156 int& qareff, // number of vector objects
157 absref **&areff); // reference to address of array
158 // containing addresses of objects.
159 */
160};
161
162/*
163Contains three methods of transmission, the fastest, slower and the slowest
164 */
165class absref_transmit virt_common_base_col {
166 public:
167 // For transmiting the members of the class, when
168 // their relative addresses are avalable:
169 int qaref; // number of vector objects which are the members of the class
170 absref(absref::** aref); // reference to address of array
171 // containing their relative addresses
172 // as class members.
173 // When the relative addresses are not available, in particular
174 // when the component object is located in heap memory:
175 int qaref_pointer; // number of vector objects
176 absref** aref_pointer; // reference to address of array
177 // containing addresses of objects.
178
179 // For any method of the object location the pointers can also be
180 // transmitted through the function get_other(int n)
181 // which receive the index of requested object and returns its address.
182 // For this the user should determine the class derived
183 // from absref_transmit. This is the most slow method of transmittion.
184 int qaref_other; // objects available though virtual function GetOther
185
186 absref_transmit(void) : qaref(0), qaref_pointer(0), qaref_other(0) { ; }
187 absref_transmit(int fqaref, absref absref::** faref)
188 : qaref(fqaref), aref(faref), qaref_pointer(0), qaref_other(0) {
189 ;
190 }
191 absref_transmit(int fqaref_pointer, absref** faref_pointer)
192 : qaref(0),
193 qaref_pointer(fqaref_pointer),
194 aref_pointer(faref_pointer),
195 qaref_other(0) {
196 ;
197 }
198 absref_transmit(int fqaref, absref absref::** faref, int fqaref_pointer,
199 absref** faref_pointer)
200 : qaref(fqaref),
201 aref(faref),
202 qaref_pointer(fqaref_pointer),
203 aref_pointer(faref_pointer),
204 qaref_other(0) {
205 ;
206 }
207 absref_transmit(const absref_transmit& f) { *this = f; }
208 macro_copy_header(absref_transmit);
209 //virtual absref_transmit* copy(void) const ;
210 virtual void print(std::ostream& file, int l) const;
211
212 virtual absref* get_other(int n);
213 // is meant to be redefined in derived class to
214 // obtain additional address
215 // except those contained in aref and aref_pointer
216 // This default version always returns NULL.
217 virtual ~absref_transmit() { ; }
218};
219
220#define ApplyAnyFunctionToVecElements(func) \
221 { \
222 ActivePtr<absref_transmit> aref_tran_cont; \
223 get_components(aref_tran_cont); \
224 absref_transmit* aref_tran = aref_tran_cont.get(); \
225 if(aref_tran != NULL) { \
226 int n; \
227 int q = aref_tran->qaref; \
228 for(n = 0; n < q; n++)(this->*(aref_tran->aref[n])).func; \
229 q = aref_tran->qaref_pointer; \
230 for(n = 0; n < q; n++) aref_tran->aref_pointer[n]->func; \
231 q = aref_tran->qaref_other; \
232 for(n = 0; n < q; n++) { \
233 absref* ar = aref_tran->get_other(n); \
234 if(ar == NULL) break; \
235 else ar->func; \
236 } \
237 } \
238 }
239
240// **** vector ****
241
242//Each vector is presented by 3 components and correspond to some basis.
243//The components is a projection of the vector to unit basis vectors.
244//If bas==NULL than it is the primary basis.
245//So the concept of vector is more primary concept with comparison of
246//basis, since one can not postulate basis while vectors do not exist.
247
248class vec : public absref {
249 public:
251
252 friend vec operator*(const vec& v, vfloat p) {
253 return vec(v.x * p, v.y * p, v.z * p);
254 }
255 friend vec operator*=(vec& v, vfloat p) {
256 v = v * p;
257 return v;
258 }
259 friend vec operator*(vfloat p, const vec& v) {
260 return vec(v.x * p, v.y * p, v.z * p);
261 }
262 vec operator/(vfloat p) const { return vec(x / p, y / p, z / p); }
263 friend vec operator/=(vec& v, vfloat p) {
264 v = v / p;
265 return v;
266 }
267 friend vec operator+(const vec& r1, const vec& r2) {
268 return vec(r1.x + r2.x, r1.y + r2.y, r1.z + r2.z);
269 }
270 friend vec& operator+=(vec& r1, const vec& r2) {
271 r1 = r1 + r2;
272 return r1;
273 }
274 friend vec operator-(const vec& r1, const vec& r2) {
275 return vec(r1.x - r2.x, r1.y - r2.y, r1.z - r2.z);
276 }
277 friend vec operator-=(vec& r1, const vec& r2) {
278 r1 = r1 - r2;
279 return r1;
280 }
281 friend vec operator-(const vec& r) { return vec(-r.x, -r.y, -r.z); }
282 friend vfloat operator*(const vec& r1, const vec& r2) {
283 return r1.x * r2.x + r1.y * r2.y + r1.z * r2.z;
284 }
285 // vector product
286 friend vec operator||(const vec& r1, const vec& r2) {
287 return vec(r1.y * r2.z - r1.z * r2.y, r1.z * r2.x - r1.x * r2.z,
288 r1.x * r2.y - r1.y * r2.x);
289 }
290 // return 1 if precisely the same vectors and 0 otherwise
291 friend wl_inline int operator==(const vec& r1, const vec& r2);
292 // return 0 if precisely the same vectors and 1 otherwise
293 friend wl_inline int operator!=(const vec& r1, const vec& r2);
294 // return 1 if approximately the same vectors and 0 otherwise
295 // Thus r2 may be is cube with side 2*prec with center marked by r1.
296 friend wl_inline int apeq(const vec& r1, const vec& r2, vfloat prec);
297 // return 0 if approximately the same vectors and 1 otherwise
298 friend wl_inline int not_apeq(const vec& r1, const vec& r2, vfloat prec);
299 friend vfloat length(const vec& v) {
300 return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
301 }
302 friend vfloat length2(const vec& v) {
303 return (v.x * v.x + v.y * v.y + v.z * v.z);
304 }
305 friend wl_inline vec unit_vec(const vec& v);
306 // cosinus of angle between vectors
307 // If one of vectors has zero length, it makes vecerror=1 and returns 0.
308 friend vfloat cos2vec(const vec& r1, const vec& r2);
309 // angle between vectors, in interval [0, M_PI]
310 // If one of vectors has zero length, it makes vecerror=1.
311 friend vfloat ang2vec(const vec& r1, const vec& r2);
312 friend vec project_to_plane(const vec& r, const vec& normal);
313 // angle between projections of 2 vectors on plane normal to vector normal
314 // in interval [0, 2*M_PI]
315 // If one of vectors has zero length, it makes vecerror=1.
316 friend vfloat ang2projvec(const vec& r1, const vec& r2, const vec& normal);
317 // sinus of angle between vectors, 0 or positive.
318 // If one of vectors has zero length, it makes vecerror=1.
319 friend vfloat sin2vec(const vec& r1, const vec& r2);
320 // check whether the vectors are parallel, or anti-parallel.
321 // returns: 1 - parallel, -1 - antiparallel, 0 not parallel
322 // 0 if one or both vectors have zero length
323 // Thus, if angle between vectors < prec, they are parallel
324 friend wl_inline int check_par(const vec& r1, const vec& r2, vfloat prec);
325 // check whether the vectors are perpendicular.
326 // returns: 1 perpendicular, 0 not perpendicular.
327 // also 0 if one or both vectors have zero length
328 // Thus, if angle between vectors
329 // a > 0.5*M_PI - find_max( prec, vprecision )
330 // and a < 0.5*M_PI + find_max( prec, vprecision ), they are perpendicular
331 friend wl_inline int check_perp(const vec& r1, const vec& r2, vfloat prec);
332 friend wl_inline vec switch_xyz(const vec&); //don't change the vector itself
333 // constructors
334 vec(vfloat xx, vfloat yy, vfloat zz) {
335 x = xx;
336 y = yy;
337 z = zz;
338 }
339 vec() {
340 x = 0;
341 y = 0;
342 z = 0;
343 }
344 //vec( vec &pv): x(pv.x), y(pv.y), z(pv.z) {;}
345 //vec(const vec &pv): x(pv.x), y(pv.y), z(pv.z) {;}
346 //{ if(this!=NULL){x=pv.x; y=pv.y; z=pv.z;}
347 // else { mcerr<<"vec::vec:NULL pointer\n"; spexit(mcerr);}};
348 // destructor
349 virtual ~vec() {}
350 vec down_new(const basis* fabas);
351 void down(const basis* fabas);
352 vec up_new(const basis* fabas_new);
353 void up(const basis* fabas_new);
354 vec down_new(const abssyscoor* fasc);
355 void down(const abssyscoor* fasc);
356 vec up_new(const abssyscoor* fasc);
357 void up(const abssyscoor* fasc);
358
359 // make new turned vector and leave this unchanged
360 vec turn_new(const vec& dir, vfloat angle);
361 // turn this vector
362 void turn(const vec& dir, vfloat angle);
363 void shift(const vec& dir);
364
365 // The following things generate random unit vectors, currently with
366 // the help of SRANLUX.
367
368 // any direction in plane perpendicular to z-axis
369 void random_round_vec(void);
370 // any direction in conus
371 // with symmetry axis along z-axis
372 // and with angle theta (radian)
373 void random_conic_vec(double theta);
374 // any direction in 3-dim.space
375 void random_sfer_vec(void);
376
377};
378std::ostream& operator<<(std::ostream& file, const vec& v);
379
380extern vec dex; // unit vector by x
381extern vec dey; // unit vector by y
382extern vec dez; // unit vector by z
383extern vec dv0; // zero vector
384
385class vecReg : public vec, public RegPassivePtr {
386 public:
387 vecReg(vfloat xx, vfloat yy, vfloat zz) : vec(xx, yy, zz) {}
388 vecReg(void) : vec() {}
389};
390std::ostream& operator<<(std::ostream& file, const vecReg& v);
391
392#ifdef WCPPLIB_INLINE
393#include "wcpplib/geometry/vec.ic"
394#endif
395// **** basis ****
396
398 protected:
399 vec ex, ey, ez; // unit vectors giving directions of cartesian axes.
400 // Supposed to be perpendicular, therefore not public.
401
402 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
403
404 //virtual void Garef(int& fqaref , absref absref::**&faref, //fixed memory
405 // int& fqareff, absref **&fareff); // free memory
406
407 //static absref(absref::*aref[3]);
408 static absref absref::* aref[3];
409
410 public:
411 //char name[12]; // Name for debug printing
413
414 public:
415 vec Gex() const { return ex; }
416 vec Gey() const { return ey; }
417 vec Gez() const { return ez; }
418
419 basis switch_xyz(void) const; // change ex=ez; ey=ex; ez=ey
420 basis(void); // nominal basis
421 basis(const String& pname); // nominal basis
422 //basis(const basis *pabas, const char pname[12]);
423 // nominal basis measured in pabas,
424 // //used for creation of nbas in abssyscoor.
425 basis(const vec& p, const String& fname); //for longitudinal basis
426 // basis(const vec &p, const char* pname); //for longitudinal basis
427 // z-axis is parralel to p
428 // y-axis is vector product of z_new and z_old
429 // x-axis is vector product of y_new and z_new
430 // If p is parallel to z_old, the copy of old basis is created.
431 // If p is anti-parallel to z_old, the inverted copy of old basis is created.
432 // if(length(p)==0) vecerror=1;
433
434 basis(const vec& p, const vec& c, const String& pname);
435 // for more sophisticated basis:
436 // ez is parallel to p, ez=unit_vec(p)
437 // ey is perpendicular to plane which have p and c, ey=unit_vec(ez||c)
438 // ex is vector product of y and z, ex=ey||ez
439 // If p is parallel to c, or p is anti-parallel to c, vecerror=1
440 // if(length(p)==0||length(c)==0)) vecerror=1;
441
442 //basis down(void)
443 // { return basis(ex.down(), ey.down(), ez.down(), name); }
444 //basis up(basis *pabas)
445 // { return basis(ex.up(pabas), ey.up(pabas), ez.up(pabas), name); }
446 //basis( basis& pb):ex(pb.ex),ey(pb.ey),ez(pb.ez), name(pb.name) {;}
447 //basis(const basis& pb):ex(pb.ex),ey(pb.ey),ez(pb.ez), name(pb.name) {;}
448 basis(const basis& pb, const String& pname);
449 // the same basis with other name, useful for later turning
450
451 //basis& operator=(basis& fb)
452 basis(const vec& pex, const vec& pey, const vec& pez, const String& pname);
453 // direct definitions of basis by three perpendicular unit-length vectors
454
455 friend std::ostream& operator<<(std::ostream& file, const basis& b);
457 virtual void print(std::ostream& file, int l) const;
458 virtual ~basis(void) {}
459};
460extern std::ostream& operator<<(std::ostream& file, const basis& b);
461
462class basisReg : public basis, public RegPassivePtr {
463 public:
464 basisReg(void) : basis() {}
465 basisReg(const String& pname) : basis(pname) {}
466 basisReg(const vec& p, const String& fname) : basis(p, fname) {}
467 basisReg(const vec& p, const vec& c, const String& pname)
468 : basis(p, c, pname) {}
469 basisReg(const vec& pex, const vec& pey, const vec& pez, const String& pname)
470 : basis(pex, pey, pez, pname) {}
472};
473std::ostream& operator<<(std::ostream& file, const basisReg& v);
474
475// **** point ****
476
478 public:
479 vec v; //
480
481 //vec Gv(){return v;}
482 //void Pv(vec& fv){v=fv;}
483
484 private:
485 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
486
487 //virtual void Garef(int& fqaref , absref absref::**&faref, //fixed memory
488 // int& fqareff, absref **&fareff) // free memory
489 // {
490 // fqaref=1; fqareff=0; faref=&aref; fareff=NULL; }
491
492 static absref(absref::* aref);
493
494 public:
495 virtual void down(const abssyscoor* fasc);
496 virtual void up(const abssyscoor* fasc);
497 virtual void shift(const vec& dir) {
498 v += dir;
499 } // not defined for vectors, but
500 // defined for points
501 point(void) : v() {
502 ;
503 } // v is not inited
504 point(const vec& fv) : v(fv) { ; }
505 point(const vfloat& fex, const vfloat& fey, const vfloat& fez)
506 : v(fex, fey, fez) {
507 ;
508 }
509 //point( point &fp): v(fp.v){;}
510 //point(const point &fp): v(fp.v){;}
511 point& operator=(const point& fp) {
512 v = fp.v;
513 return *this;
514 }
515 vec operator-(const point& pp) const { return v - pp.v; }
516 // creates vector from pp to p
517 point operator+(const vec& fv) const { return point(v + fv); }
518 friend int operator==(const point& p1, const point& p2) {
519 return p1.v == p2.v ? 1 : 0;
520 }
521 friend int operator!=(const point& p1, const point& p2) {
522 return p1.v != p2.v ? 1 : 0;
523 }
524 friend int apeq(const point& p1, const point& p2, vfloat prec) {
525 return apeq(p1.v, p2.v, prec);
526 }
527 friend int not_apeq(const point& p1, const point& p2, vfloat prec) {
528 return not_apeq(p1.v, p2.v, prec);
529 }
530 friend std::ostream& operator<<(std::ostream& file, const point& p);
532 virtual void print(std::ostream& file, int l) const;
533 virtual ~point() {}
534
535};
536std::ostream& operator<<(std::ostream& file, const point& p);
537
538class pointReg : public point, public RegPassivePtr {
539 public:
540 pointReg(void) : point(), RegPassivePtr() {}
541 pointReg(const vec& fv) : point(fv) {}
542 pointReg(const vfloat& fex, const vfloat& fey, const vfloat& fez)
543 : point(fex, fey, fez) {}
545 virtual ~pointReg() {}
546};
547std::ostream& operator<<(std::ostream& file, const pointReg& v);
548
549// **** system of coordinates ****
550
551//System of coordinates is presented by its center, basis and
552//the maternal system of coordinate.
553//Take care: c.abas must be equal to abas->ex.abas.
554//If asc==NULL and abs(c)==0 than it is primary system of coordinate
555//and therefore
556//c.abas and abas->ex.abas must be zero,
557//baz may be zero or pointer to unit basis.
558
559#define vec_syscoor_index 0
561 public:
563 virtual const point* Gapiv(void) const = 0;
564 virtual const basis* Gabas(void) const = 0;
565 //virtual void Papiv(const point* const fapiv) =0;
566 //virtual void Pabas(const basis* const fabas) =0;
567 abssyscoor(void) : name("none") { ; }
568 abssyscoor(char* fname) : name(fname) { ; }
569 abssyscoor(const String& fname) : name(fname) { ; }
570 //abssyscoor(const abssyscoor& f):
571 virtual void print(std::ostream& file, int l) const;
572
573 virtual ~abssyscoor() { ; }
574};
575extern std::ostream& operator<<(std::ostream& file, const abssyscoor& s);
576
577class fixsyscoor : public absref, public abssyscoor, public RegPassivePtr {
578 public:
579 virtual const point* Gapiv(void) const { return &piv; }
580 virtual const basis* Gabas(void) const { return &bas; }
581 //virtual void Papiv(const point* const fapiv);
582 //virtual void Pabas(const basis* const fabas);
583 void Ppiv(const point& fpiv);
584 void Pbas(const basis& fbas);
586 ;
587 } // nominal system
588 fixsyscoor(char* fname) : abssyscoor(fname) {
589 ;
590 } // nominal system
591 fixsyscoor(const String& fname) : abssyscoor(fname) {
592 ;
593 } // nominal system
594 fixsyscoor(const point& fpiv, const basis& fbas, const String& fname)
595 : abssyscoor(fname), piv(fpiv), bas(fbas) {
596 ;
597 }
598 fixsyscoor(const point* const fapiv, const basis* const fabas,
599 const String& fname)
600 : abssyscoor(fname),
601 piv((fapiv != NULL) ? (*fapiv) : point()),
602 bas((fabas != NULL) ? (*fabas) : basis()) {
603 ;
604 }
606 : abssyscoor(f),
607 piv((f.Gapiv() != NULL) ? (*(f.Gapiv())) : point()),
608 bas((f.Gabas() != NULL) ? (*(f.Gabas())) : basis()) {
609 ;
610 }
611 virtual void print(std::ostream& file, int l) const;
613 virtual ~fixsyscoor() { ; }
614
615 protected:
616 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
617 //virtual void Garef(int& fqaref , absref absref::**&faref, //fixed memory
618 // int& fqareff, absref **&fareff) // free memory
619 // { fqaref=2; fqareff=0; faref=&aref[0]; fareff=NULL; }
620 static absref(absref::* aref[2]);
621
622 private:
623 point piv;
624 basis bas;
625};
626extern std::ostream& operator<<(std::ostream& file, const fixsyscoor& s);
627
628#endif
#define virt_common_base_pcomma
Definition: AbsPtr.h:245
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:313
std::string String
Definition: String.h:75
Definition: vec.h:134
virtual void turn(const vec &dir, vfloat angle)
Definition: vec.cpp:60
virtual void shift(const vec &dir)
Definition: vec.cpp:64
virtual void up(const abssyscoor *fasc)
Definition: vec.cpp:55
virtual ~absref()
Definition: vec.h:137
virtual void down(const abssyscoor *fasc)
Definition: vec.cpp:50
abssyscoor(char *fname)
Definition: vec.h:568
abssyscoor(const String &fname)
Definition: vec.h:569
String name
Definition: vec.h:562
virtual ~abssyscoor()
Definition: vec.h:573
virtual void print(std::ostream &file, int l) const
Definition: vec.cpp:572
virtual const basis * Gabas(void) const =0
abssyscoor(void)
Definition: vec.h:567
virtual const point * Gapiv(void) const =0
Definition: vec.h:462
basisReg(const String &pname)
Definition: vec.h:465
basisReg(const vec &p, const vec &c, const String &pname)
Definition: vec.h:467
basisReg(const vec &pex, const vec &pey, const vec &pez, const String &pname)
Definition: vec.h:469
AnyType_copy(basisReg, basis)
basisReg(const vec &p, const String &fname)
Definition: vec.h:466
basisReg(void)
Definition: vec.h:464
Definition: vec.h:397
virtual ~basis(void)
Definition: vec.h:458
vec Gez() const
Definition: vec.h:417
basis(void)
Definition: vec.cpp:393
vec Gex() const
Definition: vec.h:415
vec ey
Definition: vec.h:399
String name
Definition: vec.h:412
virtual void print(std::ostream &file, int l) const
Definition: vec.cpp:507
AnyType_copy(basis, basis)
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: vec.cpp:379
friend std::ostream & operator<<(std::ostream &file, const basis &b)
Definition: vec.cpp:509
vec Gey() const
Definition: vec.h:416
vec ex
Definition: vec.h:399
static absref absref::* aref[3]
Definition: vec.h:408
vec ez
Definition: vec.h:399
basis switch_xyz(void) const
Definition: vec.cpp:388
void Ppiv(const point &fpiv)
Definition: vec.cpp:619
static absrefabsref::*[2] aref
Definition: vec.h:620
fixsyscoor(const String &fname)
Definition: vec.h:591
fixsyscoor(const abssyscoor &f)
Definition: vec.h:605
fixsyscoor(const point &fpiv, const basis &fbas, const String &fname)
Definition: vec.h:594
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: vec.cpp:615
macro_copy_total(fixsyscoor)
virtual void print(std::ostream &file, int l) const
Definition: vec.cpp:622
virtual const basis * Gabas(void) const
Definition: vec.h:580
fixsyscoor(void)
Definition: vec.h:585
fixsyscoor(const point *const fapiv, const basis *const fabas, const String &fname)
Definition: vec.h:598
void Pbas(const basis &fbas)
Definition: vec.cpp:620
fixsyscoor(char *fname)
Definition: vec.h:588
virtual const point * Gapiv(void) const
Definition: vec.h:579
virtual ~fixsyscoor()
Definition: vec.h:613
Definition: vec.h:538
pointReg(void)
Definition: vec.h:540
pointReg(const vec &fv)
Definition: vec.h:541
AnyType_copy(pointReg, point)
pointReg(const vfloat &fex, const vfloat &fey, const vfloat &fez)
Definition: vec.h:542
virtual ~pointReg()
Definition: vec.h:545
Definition: vec.h:477
friend int not_apeq(const point &p1, const point &p2, vfloat prec)
Definition: vec.h:527
friend int apeq(const point &p1, const point &p2, vfloat prec)
Definition: vec.h:524
vec operator-(const point &pp) const
Definition: vec.h:515
vec v
Definition: vec.h:479
friend int operator!=(const point &p1, const point &p2)
Definition: vec.h:521
virtual ~point()
Definition: vec.h:533
friend int operator==(const point &p1, const point &p2)
Definition: vec.h:518
virtual void print(std::ostream &file, int l) const
Definition: vec.cpp:555
point & operator=(const point &fp)
Definition: vec.h:511
point(void)
Definition: vec.h:501
point operator+(const vec &fv) const
Definition: vec.h:517
virtual void up(const abssyscoor *fasc)
Definition: vec.cpp:550
friend std::ostream & operator<<(std::ostream &file, const point &p)
Definition: vec.cpp:557
AnyType_copy(point, point)
virtual void shift(const vec &dir)
Definition: vec.h:497
point(const vfloat &fex, const vfloat &fey, const vfloat &fez)
Definition: vec.h:505
point(const vec &fv)
Definition: vec.h:504
virtual void down(const abssyscoor *fasc)
Definition: vec.cpp:546
Definition: vec.h:385
vecReg(vfloat xx, vfloat yy, vfloat zz)
Definition: vec.h:387
vecReg(void)
Definition: vec.h:388
Definition: vec.h:248
vec operator/(vfloat p) const
Definition: vec.h:262
void random_conic_vec(double theta)
Definition: vec.cpp:322
friend wl_inline int apeq(const vec &r1, const vec &r2, vfloat prec)
void shift(const vec &dir)
Definition: vec.cpp:302
vfloat y
Definition: vec.h:250
friend vfloat length(const vec &v)
Definition: vec.h:299
friend vec operator*(const vec &v, vfloat p)
Definition: vec.h:252
void down(const basis *fabas)
Definition: vec.cpp:247
virtual ~vec()
Definition: vec.h:349
friend vec operator+(const vec &r1, const vec &r2)
Definition: vec.h:267
friend vfloat ang2vec(const vec &r1, const vec &r2)
Definition: vec.cpp:165
friend vfloat length2(const vec &v)
Definition: vec.h:302
friend vec operator-(const vec &r1, const vec &r2)
Definition: vec.h:274
friend wl_inline int operator!=(const vec &r1, const vec &r2)
friend vfloat operator*(const vec &r1, const vec &r2)
Definition: vec.h:282
friend vec operator/=(vec &v, vfloat p)
Definition: vec.h:263
friend vec operator||(const vec &r1, const vec &r2)
Definition: vec.h:286
void random_round_vec(void)
Definition: vec.cpp:311
friend wl_inline int operator==(const vec &r1, const vec &r2)
friend wl_inline int check_par(const vec &r1, const vec &r2, vfloat prec)
friend vec operator-=(vec &r1, const vec &r2)
Definition: vec.h:277
vec up_new(const basis *fabas_new)
Definition: vec.cpp:249
friend vec & operator+=(vec &r1, const vec &r2)
Definition: vec.h:270
friend vec operator-(const vec &r)
Definition: vec.h:281
friend vec operator*=(vec &v, vfloat p)
Definition: vec.h:255
friend vec operator*(vfloat p, const vec &v)
Definition: vec.h:259
friend wl_inline vec switch_xyz(const vec &)
void random_sfer_vec(void)
Definition: vec.cpp:334
friend wl_inline int not_apeq(const vec &r1, const vec &r2, vfloat prec)
vec(vfloat xx, vfloat yy, vfloat zz)
Definition: vec.h:334
void up(const basis *fabas_new)
Definition: vec.cpp:269
friend vec project_to_plane(const vec &r, const vec &normal)
Definition: vec.cpp:200
vec()
Definition: vec.h:339
friend vfloat cos2vec(const vec &r1, const vec &r2)
Definition: vec.cpp:142
vfloat x
Definition: vec.h:250
friend wl_inline int check_perp(const vec &r1, const vec &r2, vfloat prec)
vec down_new(const basis *fabas)
Definition: vec.cpp:232
friend vfloat ang2projvec(const vec &r1, const vec &r2, const vec &normal)
Definition: vec.cpp:212
vfloat z
Definition: vec.h:250
friend vfloat sin2vec(const vec &r1, const vec &r2)
Definition: vec.cpp:183
friend wl_inline vec unit_vec(const vec &v)
void turn(const vec &dir, vfloat angle)
Definition: vec.cpp:298
vec turn_new(const vec &dir, vfloat angle)
Definition: vec.cpp:271
virtual void print(std::ostream &file, int l) const
virtual absref * get_other(int n)
absref_transmit(int fqaref, absref absref::**faref, int fqaref_pointer, absref **faref_pointer)
Definition: vec.h:198
absref_transmit(int fqaref_pointer, absref **faref_pointer)
Definition: vec.h:191
absref_transmit(void)
Definition: vec.h:186
absref ** aref_pointer
Definition: vec.h:176
macro_copy_header(absref_transmit)
absref_transmit(const absref_transmit &f)
Definition: vec.h:207
virtual ~absref_transmit()
Definition: vec.h:217
absref_transmit(int fqaref, absref absref::**faref)
Definition: vec.h:187
#define wl_inline
Definition: inlinec.h:15
std::ostream & operator<<(std::ostream &file, const vec &v)
Definition: vec.cpp:346
vec dex
vec dv0
vec dey
vec dez
int vecerror
Definition: vec.cpp:31
double vfloat
Definition: vfloat.h:15