Changeset 2973 in Sophya for trunk/SophyaLib/SkyMap/vector3d.h


Ignore:
Timestamp:
Jun 20, 2006, 6:01:49 PM (19 years ago)
Author:
ansari
Message:

1/ Nettoyage+commentaires/doxygen ds Vector3d, UnitVector, LongLat,
SphereCoordSys ...
2/ Ajout de la classe angle pour faciliter les conversions rad<>deg<>arcmin
dans le fichier vector3d.h .cc
3/ nettoyage/uniformisation methodes print pour pixelmap, ajout de la
methode PixelMap<T>::Show()
4/ Ajout methodes SphericalMap<T>::HasSymThetaSlice() et
GetSymThetaSliceIndex(int_4 idx) et leurs implementations pour
SphereHEALPix et SphereThetaPhi en vue de l'optimisation du calcul
transforme Ylm
5/ Ajout methode ResolToSizeIndex ds SphereThetaPhi , SphereHEALPix et
SphereECP

Reza , 20 Juin 2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SkyMap/vector3d.h

    r2322 r2973  
    11//   3-D Geometry
    22//        B. Revenu, G. Le Meur   2000
     3//        R. Ansari 2006
    34// DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
    45
     
    1516#include "longlat.h"
    1617
     18
     19namespace SOPHYA {
     20
     21//! Class to ease angle conversions (radian <> degree <> arcmin <> arcsec)
     22class Angle {
     23public:
     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
     44protected: 
     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
    1754/*
    1855  Geometrie en dimension 3.
     
    2057  et en coordonnees spheriques theta,phi
    2158  pour les rotations (angles d'Euler) ma source est
     59  B. Revenu / G. Le Meur
    2260  "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
    2361*/
    24 /*!    3-D geometry.
    25 
    26     All computations are made with angles in radians and with spherical
    27     coordinates theta, phi.
    28 
    29     Concerning Euler's angles, the reference is :
    30  
    31     "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
    32 */
    33 
    34 namespace SOPHYA {
    3562 
    3663class Vector3d
     
    6592
    6693  // 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]
    6895  virtual double SepAngle(const Vector3d&) const;
    6996
    7097  // 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;
    73100
    74101  // vecteur perpendiculaire de meme phi
    75   /*!    perpendicular vector, with equal phi */
     102  //! return the perpendicular vector, with equal phi
    76103  virtual Vector3d VperpPhi() const;
    77104
    78105  // vecteur perpendiculaire de meme theta
    79   /*!    perpendicular vector with equal theta */
     106  //! return the perpendicular vector, with equal theta
    80107  virtual Vector3d VperpTheta() const;
    81108
     
    84111
    85112  // rotations d'Euler
    86   /*!    Euler's rotations */
    87   // rotations d Euler
     113  //! Perform   Euler's rotations
    88114  virtual Vector3d Euler(double, double, double) const;
    89115
    90116  // rotation inverse
    91   /*!    inverse rotation */
     117  //! perform   inverse Euler rotation
    92118  Vector3d InvEuler(double, double, double) const;
    93119
    94120  // 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)
    96122  Vector3d Rotate(const Vector3d& omega,double phi) const;
    97123
     
    148174}
    149175
     176
    150177} // namespace SOPHYA
    151178
Note: See TracChangeset for help on using the changeset viewer.