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