[262] | 1 | #ifndef CIRCLE_H_SEEN
|
---|
| 2 | #define CIRCLE_H_SEEN
|
---|
| 3 |
|
---|
| 4 | #include <math.h>
|
---|
| 5 | #include <iostream.h>
|
---|
| 6 | #include "vector3d.h"
|
---|
| 7 | #include "unitvector.h"
|
---|
| 8 | #include "utilgeom.h"
|
---|
[470] | 9 | #include "geometry.h"
|
---|
[262] | 10 |
|
---|
[470] | 11 | class Circle : public Geometry
|
---|
[262] | 12 | {
|
---|
| 13 |
|
---|
| 14 | public:
|
---|
| 15 |
|
---|
| 16 | Circle();
|
---|
| 17 | Circle(double theta, double phi, double aperture);
|
---|
| 18 | Circle(double x, double y, double z, double aperture);
|
---|
| 19 | Circle(const Vector3d& v, double aperture=M_PI/2.);
|
---|
| 20 | Circle(const Circle& c);
|
---|
| 21 | virtual ~Circle() {}
|
---|
| 22 |
|
---|
| 23 | void SetCircle(const UnitVector&, double);
|
---|
| 24 | void SetSpinAxis(double theta, double phi);
|
---|
| 25 | void SetSpinAxis(const Vector3d&);
|
---|
| 26 | void SetSpinAxis(double x, double y, double z);
|
---|
| 27 | void SetApertureAngle(double aperture);
|
---|
| 28 | void SetApertureAngle(const Circle&);
|
---|
| 29 |
|
---|
[470] | 30 | // psi contient les 4 valeurs des angles d intersection. -1 si les cercles ne se coupent pas
|
---|
[262] | 31 | // voir la numerotation dans le .cc
|
---|
| 32 | bool Intersection(const Circle&, double* psi) const;
|
---|
| 33 |
|
---|
| 34 | // donne le UnitVector correspondant a une position donnee sur le cercle
|
---|
[470] | 35 | UnitVector ConvToSphere(double psi) const;
|
---|
[262] | 36 |
|
---|
| 37 | // donne le UnitVector correspondant la tangente au cercle en une position donnee sur le cercle
|
---|
| 38 | UnitVector TanOnCircle(double psi) const;
|
---|
| 39 |
|
---|
| 40 | // donne le vecteur tangent dans le plan (xy) a la sphere en une position donnee sur le cercle
|
---|
| 41 | UnitVector EPhi(double psi) const;
|
---|
| 42 |
|
---|
[470] | 43 | // donne l autre vecteur tangent (orthogonal a EPhi)
|
---|
[262] | 44 | UnitVector ETheta(double psi) const;
|
---|
| 45 |
|
---|
[470] | 46 | // donne l angle de separation dans [0,2Pi] en une position donnee sur le cercle et EPhi
|
---|
[262] | 47 | double SepAngleTanEPhi02PI(double psi) const;
|
---|
| 48 |
|
---|
| 49 | double Theta() const {return _spinaxis.Theta();}
|
---|
| 50 | double Phi() const {return _spinaxis.Phi();}
|
---|
| 51 | double ApertureAngle() const {return _angouv;}
|
---|
| 52 | Vector3d Omega() const {return _spinaxis;}
|
---|
| 53 | virtual void Print(ostream&) const;
|
---|
| 54 | Circle& operator=(const Circle&);
|
---|
| 55 | bool operator==(const Circle&) const;
|
---|
| 56 | bool operator!=(const Circle&) const;
|
---|
| 57 |
|
---|
| 58 | private:
|
---|
| 59 |
|
---|
| 60 | Vector3d _spinaxis;
|
---|
| 61 | UnitVector _spinunitaxis;
|
---|
| 62 | double _angouv;
|
---|
| 63 | double _theta,_phi;
|
---|
| 64 | double _x,_y,_z;
|
---|
| 65 |
|
---|
| 66 | };
|
---|
| 67 |
|
---|
| 68 | inline ostream& operator<<(ostream& s, const Circle& c)
|
---|
| 69 | {
|
---|
| 70 | c.Print(s);
|
---|
| 71 | return s;
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | #endif
|
---|