Changeset 2973 in Sophya for trunk/SophyaLib/SkyMap/vector3d.h
- Timestamp:
- Jun 20, 2006, 6:01:49 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/vector3d.h
r2322 r2973 1 1 // 3-D Geometry 2 2 // B. Revenu, G. Le Meur 2000 3 // R. Ansari 2006 3 4 // DAPNIA/SPP (Saclay) / CEA LAL - IN2P3/CNRS (Orsay) 4 5 … … 15 16 #include "longlat.h" 16 17 18 19 namespace SOPHYA { 20 21 //! Class to ease angle conversions (radian <> degree <> arcmin <> arcsec) 22 class Angle { 23 public: 24 enum AngleUnit { Radian, Degree, ArcMin, ArcSec }; 25 //! Constructor with specification of angle value in radian 26 Angle(double val=0.) { _angrad = val; } 27 //! Constructor with specification of angle value and unit 28 Angle(double val, Angle::AngleUnit un); 29 //! Copy constructor 30 Angle(Angle const& a) { _angrad = a._angrad; } 31 32 //! Conversion to radian 33 inline double ToRadian() const { return _angrad; } 34 //! Conversion to degree 35 inline double ToDegree() const { return _angrad*_rad2deg; } 36 //! Conversion to arcmin 37 inline double ToArcMin() const { return _angrad*_rad2min; } 38 //! Conversion to arcsec 39 inline double ToArcSec() const { return _angrad*_rad2sec; } 40 41 //! return the angle value in radian 42 inline operator double () const { return _angrad; } 43 44 protected: 45 double _angrad; // angle in radians 46 47 static double _deg2rad; // deg -> radian conversion factor 48 static double _rad2deg; // rad -> degree conversion factor 49 static double _rad2min; // rad -> arcmin conversion factor 50 static double _rad2sec; // rad -> arcmin conversion factor 51 52 }; 53 17 54 /* 18 55 Geometrie en dimension 3. … … 20 57 et en coordonnees spheriques theta,phi 21 58 pour les rotations (angles d'Euler) ma source est 59 B. Revenu / G. Le Meur 22 60 "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley 23 61 */ 24 /*! 3-D geometry.25 26 All computations are made with angles in radians and with spherical27 coordinates theta, phi.28 29 Concerning Euler's angles, the reference is :30 31 "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley32 */33 34 namespace SOPHYA {35 62 36 63 class Vector3d … … 65 92 66 93 // ecart angulaire entre 2 vecteurs dans [0,Pi] 67 / *! angular gap between 2 vectors in [0,Pi] */94 //! angular gap between 2 vectors in [0,Pi] 68 95 virtual double SepAngle(const Vector3d&) const; 69 96 70 97 // produit vectoriel 71 / *! vector product */72 virtual Vector3d Vect(const Vector3d& ) const;98 //! return the vector product (*this)^v2 99 virtual Vector3d Vect(const Vector3d& v2) const; 73 100 74 101 // vecteur perpendiculaire de meme phi 75 / *! perpendicular vector, with equal phi */102 //! return the perpendicular vector, with equal phi 76 103 virtual Vector3d VperpPhi() const; 77 104 78 105 // vecteur perpendiculaire de meme theta 79 / *! perpendicular vector with equal theta */106 //! return the perpendicular vector, with equal theta 80 107 virtual Vector3d VperpTheta() const; 81 108 … … 84 111 85 112 // rotations d'Euler 86 /*! Euler's rotations */ 87 // rotations d Euler 113 //! Perform Euler's rotations 88 114 virtual Vector3d Euler(double, double, double) const; 89 115 90 116 // rotation inverse 91 / *! inverse rotation */117 //! perform inverse Euler rotation 92 118 Vector3d InvEuler(double, double, double) const; 93 119 94 120 // rotation d'angle phi autour d'un axe omega (regle du tire-bouchon) 95 / *! rotation of angle phi around an axis omega (Maxwell's rule) */121 //! perform rotation of angle phi around an axis omega (Maxwell's rule) 96 122 Vector3d Rotate(const Vector3d& omega,double phi) const; 97 123 … … 148 174 } 149 175 176 150 177 } // namespace SOPHYA 151 178
Note:
See TracChangeset
for help on using the changeset viewer.