Changeset 565 in Sophya for trunk/SophyaLib


Ignore:
Timestamp:
Nov 10, 1999, 3:01:46 PM (26 years ago)
Author:
ansari
Message:

ajout doc GLM

Location:
trunk/SophyaLib/Samba
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/scan.h

    r228 r565  
    77#include <iostream.h>
    88#include "dvlist.h"
    9 class Scan : public PPersist {
     9#include "ndatablock.h"
     10//!   Storage and treatment of data for a scanning of a part of the sky with a set of given values for parameters (see constructor)
    1011
     12class Scan :  public AnyDataObj  {
     13  //  friend FIO_Scan;
    1114  public  :
    1215    /*
     
    2225  . offset d'antenne en angle phi
    2326  */
     27
     28    /*!
     29\verbatim
     30    * Ouv      = aperture angle (rad)
     31    * Omega[3] = direction of rotation axis of the satellite (teta,phi)
     32                 and rotation velocity (rad/s)
     33    * Fech     = sampling frequency  (Hz)
     34    * T        = total time of data acquistion (s)
     35    * t0       = starting time (s)
     36    * phi0     = offset of antenna (rad)
     37\endverbatim
     38    */
    2439Scan(float,float*,float,float,float,float);
    2540Scan(const Scan& );
    2641Scan() {
    2742  InitNull();
    28   cout << " constructeur de scan par defaut" << endl;
    2943}
    3044~Scan();
     
    3246// ------------ Persistence handling
    3347
    34      enum {classId = 0xF003 };
    35 int_4                  ClassId() const        { return classId; }
     48//     enum {classId = 0xF003 };
     49//int_4                  ClassId() const        { return classId; }
    3650
    37 virtual void           WriteSelf(POutPersist&) const;
    38 virtual void           ReadSelf(PInPersist&);
     51//virtual void           WriteSelf(POutPersist&) const;
     52//virtual void           ReadSelf(PInPersist&);
    3953
     54/*!   Return the number of points in the scan */
    4055int_4     NbPoints() const;
     56/*!    Return total nomber of turns */
    4157int_4     NbTours() const;
     58/*!    Return  nomber of points for 1 turn */
    4259int_4     NbPts1Tr() const;
     60/*!    Return index of pixel associated to time t */
    4361int_4     ValueIndex(float) const;
     62/*!    Return  (teta,phi) coordinate of pixel related to time t */
    4463void    Direction(float, float& ,float& );
     64/*!    Return  (teta,phi) coordinates of  pixel with index k */
    4565void    DirectionIndex(int_4,float& ,float& );
    46 double& PixelValue(int_4 k) const;
     66/*!    Return value of pixel with index k */
     67r_8  & PixelValue(int_4 k) ;
     68/*!    const version of previous method */
     69r_8 const & PixelValue(int_4 k) const;
    4770
    4871/* Surcharge de la parenthese a un indice entier : remplit ou/et renvoie */
    4972/* la valeur du contenu du pixel d'indice k                              */
    50 
    51   inline  double&        operator()(int_4 k)
     73 
     74  inline  r_8&    operator()(int_4 k)
    5275                                      { return(PixelValue(k)) ; } ;
     76  inline  r_8 const &    operator()(int_4 k) const
     77                                      { return(PixelValue(k)) ; } ;
     78  Scan& operator = (const Scan& s);
    5379//++
    5480DVList&  Info()
     
    5682//      Renvoie une reference sur l'objet DVList Associe
    5783//--
    58 {
     84{ 
    5985if (mInfo_ == NULL)  mInfo_ = new DVList;
    6086return(*mInfo_);
    6187}
    6288
     89const DVList*  ptrInfo() const
     90  {
     91    return mInfo_;
     92  }
     93
     94
     95
     96inline  void  SetIntParams(int_4 NmaxPts, int_4 NmaxTrs, int_4 NPts1Tr)
     97  {
     98    NmaxPts_=NmaxPts;
     99    NmaxTrs_=NmaxTrs;
     100    NPts1Tr_=NPts1Tr;
     101  }
     102 inline void SetFloatParams(r_4 Ouverture, r_4 OmegaTeta, r_4 OmegaPhi,
     103                            r_4 OmegaRad, r_4 FrequenceEch, r_4 TempsFinal,
     104                            r_4 TempsInitial, r_4 PhiZero, r_8* Rota)
     105   {
     106     Ouverture_    = Ouverture;
     107     OmegaTeta_    = OmegaTeta;
     108     OmegaPhi_     = OmegaPhi;
     109     OmegaRad_     = OmegaRad;
     110     FrequenceEch_ = FrequenceEch;
     111     TempsFinal_   = TempsFinal;
     112     TempsInitial_ = TempsInitial;
     113     PhiZero_      = PhiZero;
     114     for (int k=0; k<9;k++) Rota_[k]=Rota[k];
     115   }
     116
     117 inline void GetFloatParams(r_4& Ouverture, r_4& OmegaTeta, r_4& OmegaPhi,
     118                            r_4& OmegaRad, r_4& FrequenceEch, r_4& TempsFinal,
     119                            r_4& TempsInitial, r_4& PhiZero, r_8* Rota) const
     120   {
     121     Ouverture    = Ouverture_;
     122     OmegaTeta    = OmegaTeta_;
     123     OmegaPhi     = OmegaPhi_;
     124     OmegaRad     = OmegaRad_;
     125     FrequenceEch = FrequenceEch_;
     126     TempsFinal   = TempsFinal_;
     127     TempsInitial = TempsInitial_;
     128     PhiZero      = PhiZero_;
     129     for (int k=0; k<9;k++) Rota[k]=Rota_[k];
     130   }
     131
     132/* retourne le pointeur vers/remplit  le vecteur des contenus des pixels */
     133inline const NDataBlock<r_8>* getDataBlock() const {return (&sPix_);}
     134inline void setDataBlock(r_8* data, int n) {sPix_.FillFrom(n,data);}
    63135
    64136  private :
    65137   
    66 void          Clear();
     138    //void          Clear();
    67139void          InitNull();
    68140
    69 int_4 NmaxPts_;
    70 int_4 NmaxTrs_;
    71 int_4 NPts1Tr_;
    72 r_4   Ouverture_;
    73 r_4   OmegaTeta_;     /* direction de l'axe de rotation du satellite */
    74 r_4   OmegaPhi_;      /* (radians)                                   */
    75 r_4   OmegaRad_;      /* vitesse de rotation du satellite (radians/s) */
    76 r_4   FrequenceEch_;  /* frequence d'echantillonnage (Hz)*/
    77 r_4   TempsFinal_;
    78 r_4   TempsInitial_;
    79 r_4   PhiZero_;       /* Offset antenne (radians)  */
    80 r_8*  sPix_;          /* valeurs contenues dans chaque pixel */
    81 r_8   Rota_[9];       /* matrice de passage : [Xf]=[Rota][Xs] */
     141
     142 int_4 NmaxPts_;
     143 int_4 NmaxTrs_;
     144 int_4 NPts1Tr_;
     145 r_4   Ouverture_;
     146 r_4   OmegaTeta_;     /* direction de l'axe de rotation du satellite */
     147 r_4   OmegaPhi_;      /* (radians)                                   */
     148 r_4   OmegaRad_;      /* vitesse de rotation du satellite (radians/s) */
     149 r_4   FrequenceEch_;  /* frequence d'echantillonnage (Hz)*/
     150 r_4   TempsFinal_;
     151 r_4   TempsInitial_;
     152 r_4   PhiZero_;           /* Offset antenne (radians)  */
     153 NDataBlock<r_8>  sPix_;   /* valeurs contenues dans chaque pixel */
     154 //r_8*  sPix_;            /* valeurs contenues dans chaque pixel */
     155 r_8   Rota_[9];       /* matrice de passage : [Xf]=[Rota][Xs] */
    82156                      /* Xs : coordonnees dans un systeme lie au satellite*/
    83157                      /* Xf : coordonnees dans un repere "fixe"           */
    84 DVList* mInfo_;        // Infos (variables) attachees
     158 DVList* mInfo_;        // Infos (variables) attachees
     159};
     160
     161// ------------- Classe pour la gestion de persistance --
     162//!    Delegated objects for persitance management
     163
     164class FIO_Scan : public PPersist 
     165{
     166
     167public:
     168
     169FIO_Scan();
     170FIO_Scan(string const & filename);
     171FIO_Scan(const Scan& obj);
     172FIO_Scan(Scan* obj);
     173virtual ~FIO_Scan();
     174virtual AnyDataObj* DataObj();
     175inline operator Scan() {return(*dobj); }
     176
     177protected :
     178
     179virtual void ReadSelf(PInPersist&);           
     180virtual void WriteSelf(POutPersist&) const; 
     181Scan* dobj;
     182bool ownobj;
    85183};
    86184
  • trunk/SophyaLib/Samba/spheregorski.cc

    r518 r565  
    158158//    to phi = 0
    159159//
    160 //    nside DOIT OBLIGATOIREMENT ETRE UNE PUISSANCE DE 2 (<= 8192)
     160//    nside MUST be a power of 2 (<= 8192)
    161161//--
    162162//++
     
    166166//    SphericalMap
    167167//--
    168 //++
    169 //
    170 // Links        Descendants
    171 //
    172 //     
    173 //--
    174168
    175169/* --Methode-- */
    176170//++
    177 // Titre        Constructeurs
     171// Titre        Constructors
    178172//--
    179173//++
     
    191185SphereGorski<T>::SphereGorski(int m)
    192186
    193 //    Constructeur : m est la variable nside de l'algorithme de Gorski
    194 //    le nombre total de pixels sera Npix =  12*nside**2
    195 //    m DOIT OBLIGATOIREMENT ETRE UNE PUISSANCE DE 2 (<= 8192)
     187//    m is the "nside" of the Gorski algorithm
     188//
     189//    The total number of pixels will be Npix =  12*nside**2
     190//
     191//    nside MUST be a power of 2 (<= 8192)
    196192//--
    197193{
     
    213209  Pixelize(m);
    214210}
    215 
     211//++
    216212template<class T>
    217213SphereGorski<T>::SphereGorski(const SphereGorski<T>& s)
     214
     215//    copy constructor
     216//--
    218217{
    219218  cout << " constructeur de recopie " << endl;
     
    229228
    230229//++
    231 // Titre        Destructeur
     230// Titre        Destructor
    232231//--
    233232//++
     
    241240
    242241//++
    243 // Titre        Méthodes
     242// Titre        Public Methods
    244243//--
    245244
     
    248247void SphereGorski<T>::Resize(int m)
    249248
    250 //    m est la variable nside de l'algorithme de Gorski
    251 //    le nombre total de pixels sera Npix =  12*nside**2
    252 //    m DOIT OBLIGATOIREMENT ETRE UNE PUISSANCE DE 2 (<= 8192)
     249//    m is the "nside" of the Gorski algorithm
     250//
     251//    The total number of pixels will be Npix =  12*nside**2
     252//
     253//    nside MUST be a power of 2 (<= 8192)
    253254//--
    254255{
     
    276277//
    277278//   
    278 //--
    279279{
    280280  // On memorise les arguments d'appel
     
    325325int SphereGorski<T>::NbThetaSlices() const
    326326
    327 //    Retourne le nombre de tranches en theta sur la sphere
     327//    Return number of slices in theta direction on the sphere
    328328//--
    329329{
     
    335335void SphereGorski<T>::GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const
    336336
    337 //    Retourne, pour la tranche en theta d'indice 'index' le theta
    338 //    correspondant, un vecteur (Peida) contenant les phi des pixels de
    339 //    la tranche, un vecteur (Peida) contenant les valeurs de pixel
    340 //    correspondantes
     337//    For a theta-slice with index 'index', return :
     338//
     339//    the corresponding "theta"
     340//
     341//    a vector containing the phi's of the pixels of the slice
     342//
     343//    a vector containing the corresponding values of pixels
     344//
    341345//--
    342346{
     
    387391T& SphereGorski<T>::PixVal(int k)
    388392
    389 //    Retourne la valeur du contenu du pixel d'indice "RING" k
     393//    Return value of  pixel with "RING" index k
    390394//--
    391395{
     
    404408T const& SphereGorski<T>::PixVal(int k) const
    405409
    406 //    Retourne la valeur du contenu du pixel d'indice "RING" k
     410//    Return value of  pixel with "RING" index k
    407411//--
    408412{
     
    420424T& SphereGorski<T>::PixValNest(int k)
    421425
    422 //    Retourne la valeur du contenu du pixel d'indice "NESTED" k
     426//    Return value of  pixel with "NESTED" index k
    423427//--
    424428{
     
    436440T const& SphereGorski<T>::PixValNest(int k) const
    437441
    438 //    Retourne la valeur du contenu du pixel d'indice "NESTED" k
     442//    Return value of  pixel with "NESTED" index k
    439443//--
    440444{
     
    463467int SphereGorski<T>::PixIndexSph(double theta,double phi) const
    464468
    465 //    Retourne l'indice "RING" du pixel vers lequel pointe une direction
    466 //    définie par ses coordonnées sphériques
     469//    Return "RING" index of the pixel corresponding to
     470//    direction (theta, phi).
    467471//--
    468472{
     
    474478int SphereGorski<T>::PixIndexSphNest(double theta,double  phi) const
    475479
    476 //    Retourne l'indice NESTED" du pixel vers lequel pointe une direction
    477 //    définie par ses coordonnées sphériques
     480//    Return "NESTED" index of the pixel corresponding to
     481//    direction (theta, phi).
    478482//--
    479483{
     
    487491void SphereGorski<T>::PixThetaPhi(int k,double& theta,double& phi) const
    488492
    489 //   Retourne les coordonnées (theta,phi) du milieu du pixel d'indice "RING" k
     493//   Return (theta,phi) coordinates of middle of  pixel with "RING" index k
    490494//--
    491495{
     
    509513void SphereGorski<T>::PixThetaPhiNest(int k,double& theta,double& phi) const
    510514
    511 //    Retourne les coordonnées (theta,phi) du milieu du pixel d'indice
    512 //    NESTED k
     515//   Return (theta,phi) coordinates of middle of  pixel with "NESTED" index k
    513516//--
    514517{   
     
    520523int SphereGorski<T>::NestToRing(int k) const
    521524
    522 //    conversion d'index NESTD en un index RING
     525//    translation from NESTED index  into RING index
    523526//
    524527//--
     
    531534int SphereGorski<T>::RingToNest(int k) const
    532535//
    533 //    conversion d'index RING en un index NESTED
     536//    translation from  RING index  into NESTED index
    534537//
    535538//--
     
    11401143void FIO_SphereGorski<T>::ReadSelf(PInPersist& is)
    11411144{
    1142   cout << " FIO_SphereGorski:: ReadSelf " << endl;
    11431145
    11441146  if(dobj == NULL)
     
    11831185void FIO_SphereGorski<T>::WriteSelf(POutPersist& os) const
    11841186{
    1185   cout << " FIO_SphereGorski:: WriteSelf " << endl;
    11861187
    11871188  if(dobj == NULL)
  • trunk/SophyaLib/Samba/spheregorski.h

    r518 r565  
    1212// ***************** CLASSE SphereGorski *****************************
    1313
     14//!  class SphereGorski
     15/*!
     16   Pixelisation Gorski 
     17
     18
     19    -----------------------------------------------------------------------
     20     version 0.8.2  Aug97 TAC  Eric Hivon, Kris Gorski
     21    -----------------------------------------------------------------------
     22
     23    the sphere is split in 12 diamond-faces containing nside**2 pixels each
     24
     25    the numbering of the pixels (in the nested scheme) is similar to
     26    quad-cube
     27    In each face the first pixel is in the lowest corner of the diamond
     28
     29    the faces are                    (x,y) coordinate on each face
     30\verbatim
     31        .   .   .   .   <--- North Pole
     32       / \ / \ / \ / \                          ^        ^     
     33      . 0 . 1 . 2 . 3 . <--- z = 2/3             \      /
     34       \ / \ / \ / \ /                        y   \    /  x 
     35      4 . 5 . 6 . 7 . 4 <--- equator               \  /     
     36       / \ / \ / \ / \                              \/     
     37      . 8 . 9 .10 .11 . <--- z = -2/3              (0,0) : lowest corner
     38       \ / \ / \ / \ /     
     39        .   .   .   .   <--- South Pole
     40\endverbatim
     41    phi:0               2Pi                                 
     42
     43   in the ring scheme pixels are numbered along the parallels
     44   the first parallel is the one closest to the north pole and so on 
     45   on each parallel, pixels are numbered starting from the one closest
     46    to phi = 0
     47
     48    nside MUST be a power of 2 (<= 8192)
     49
     50*/
     51
    1452template<class T>
    1553class SphereGorski : public SphericalMap<T>,  public AnyDataObj
     
    1957
    2058SphereGorski();
     59/*!   
     60  m is the "nside" of the Gorski algorithm
     61
     62  The total number of pixels will be Npix =  12*nside**2
     63
     64  nside MUST be a power of 2 (<= 8192)
     65*/
    2166SphereGorski(int m);
    2267SphereGorski(const SphereGorski<T>& s);
     68//!     Destructor
    2369virtual ~SphereGorski();
    2470
     
    2672
    2773/* Nombre de pixels du decoupage */
     74/*!    Return number of  pixels of the  splitting */
    2875virtual int NbPixels() const;
    2976inline void setNbPixels(int n) {nPix_= n;}
    3077
    3178/* Valeur du contenu du pixel d'indice "RING" k  */
     79/*!    Return value of  pixel with "RING" index k */
    3280virtual T& PixVal(int k);
    3381virtual T const& PixVal(int k) const;
    3482
    3583/* Nombre de tranches en theta */
     84/*!    Return number of slices in theta direction on the  sphere */
    3685int NbThetaSlices() const;
     86/*!   For a theta-slice with index 'index', return :
     87
     88   the corresponding "theta"
     89
     90    a vector containing the phi's of the pixels of the slice
     91
     92    a vector containing the corresponding values of pixels
     93*/
    3794void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const;
    3895
     
    4198/* Indice "RING" du pixel vers lequel pointe une direction definie par
    4299ses  coordonnees spheriques */                                   
     100/*!  Return "RING" index of the pixel corresponding to direction (theta, phi).
     101 */
    43102virtual int PixIndexSph(double theta,double phi) const;
    44103
     
    47106
    48107/* Pixel Solid angle  (steradians) */
     108/*!    Pixel Solid angle  (steradians)
     109
     110    All the pixels have the same solid angle. The dummy argument is
     111    for compatibility with eventual pixelizations which would not
     112   fulfil this requirement.
     113*/
    49114virtual double PixSolAngle(int dummy) const;
    50115inline void setPixSolAngle(double x) {omeg_= x;}
     
    52117// --------------- Specific methods
    53118
     119/*!   
     120  m is the "nside" of the Gorski algorithm
     121
     122  The total number of pixels will be Npix =  12*nside**2
     123
     124  nside MUST be a power of 2 (<= 8192)
     125*/
    54126virtual void Resize(int m);
    55127
     
    57129
    58130/* Valeur du contenu du pixel d'indice "NEST" k */
     131/*!    Return value of  pixel with "NESTED" index k */
    59132virtual T& PixValNest(int k);
     133/*!    Return value of  pixel with "NESTED" index k */
    60134virtual T const& PixValNest(int k) const;
    61135
    62136/* Indice "NEST" du pixel vers lequel pointe une direction definie par
    63137ses  coordonnees spheriques */                                   
     138/*! Return "NESTED" index of the pixel corresponding to direction (theta, phi).
     139 */
    64140virtual int PixIndexSphNest(double theta,double phi) const;
    65141
    66142/* Coordonnees spheriques du milieu du pixel d'indice "NEST" k       */
     143/*!   Return (theta,phi) coordinates of middle of  pixel with "NESTED" index k
     144 */
    67145virtual void PixThetaPhiNest(int k,double& theta,double& phi) const;
    68146
     
    71149
    72150/* convertit index nested en ring  */
     151/*!    translation from NESTED index  into RING index */
    73152int NestToRing(int) const;
    74153
    75154/* convertit index ring en nested" */
     155/*!    translation from  RING index  into NESTED index */
    76156int RingToNest(int) const;
    77157
     
    127207virtual AnyDataObj* DataObj();
    128208inline operator SphereGorski<T>() { return(*dobj); }
    129 inline SphereGorski<T> getObj() { return(*dobj); }
     209//inline SphereGorski<T> getObj() { return(*dobj); }
    130210
    131211protected :
  • trunk/SophyaLib/Samba/spherethetaphi.cc

    r518 r565  
    1313// include      spherethetaphi.h nbmath.h
    1414//
    15 //    Découpage de la sphère selon theta et phi, chaque
    16 //    hémisphère étant découpé en (m-1) parallèles (l'équateur compte pour du
    17 //    beurre), chacune des m bandes de theta ainsi définies étant découpée par
    18 //    des méridiens équirepartis, ce découpage étant fait de sorte que tous
    19 //    les pixels aient la même surface et soient le plus carré possible.
    20 //    On commence par découper l'hémisphère de z positif en partant du pôle et
    21 //    en allant vers l'équateur. Le premier pixel est la calotte polaire,
    22 //    il est circulaire et centré sur theta=0.
     15//    sphere splitted with respect to theta, phi : each hemisphere is
     16//    splitted into (m-1) parallels (equator does not enter into account).
     17//    This operation defines m slices, each of which is splitted into
     18//    equidistant meridians. This splitting is realized in such a way that
     19//    all pixels have the same area and are as square as possible.
     20
     21//    One begins with the hemisphere with positive z, starting from the pole
     22//    toward the equator. The first pixel is the polar cap ; it is circular
     23//    and centered on theta=0.
    2324//--
    2425//++
     
    2829//    SphericalMap
    2930//--
    30 //++
    31 //
    32 // Links        Descendants
    33 //
    34 //     
    35 //--
    36 
    37 /* --Methode-- */
    38 //++
    39 // Titre        Constructeurs
     31
     32/* --Methode-- */
     33//++
     34// Titre        Constructors
    4035//--
    4136//++
     
    5651SphereThetaPhi<T>::SphereThetaPhi(int m)
    5752
    58 //    Constructeur : m est le nombre de bandes en theta sur un hémisphère
    59 //    (la calotte constituant la premiere bande).
    60 //    pet est le nombre de pixels (pétales) de la bande en contact avec la
    61 //    calotte polaire. Pour l'instant pet est inopérant!
     53//    m is the number of slices in theta on an hemisphere (the polar cap
     54//    forms the first slice).
     55//    pet is a dummy parameter at the moment.
    6256//--
    6357{
     
    8882
    8983//++
    90 // Titre        Destructeur
     84// Titre        Destructor
    9185//--
    9286//++
     
    10094
    10195//++
    102 // Titre        Méthodes
     96// Titre        Public Méthods
    10397//--
    10498template <class T>
     
    141135int SphereThetaPhi<T>::NbPixels() const
    142136
    143 //    Retourne le nombre de pixels du découpage
     137//    Return total number of pixels
    144138//--
    145139{
     
    152146T& SphereThetaPhi<T>::PixVal(int k)
    153147
    154 //    Retourne la valeur du contenu du pixel d'indice k
     148//    Return value of pixel with index k
    155149//--
    156150{
     
    168162T const& SphereThetaPhi<T>::PixVal(int k) const
    169163
    170 //    Retourne la valeur du contenu du pixel d'indice k
     164//    Return value of pixel with index k
    171165//--
    172166{
     
    194188int SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const
    195189
    196 //  Retourne l'indice du pixel vers lequel pointe une direction définie par
    197 //    ses coordonnées sphériques
     190//    Return index of the pixel corresponding to
     191//    direction (theta, phi).
    198192//--
    199193{
     
    223217void SphereThetaPhi<T>::PixThetaPhi(int k,double& theta,double& phi) const
    224218
    225 //    Retourne les coordonnées (theta,phi) du milieu du pixel d'indice k
     219//   Return (theta,phi) coordinates of middle of  pixel with  index k
    226220//--
    227221{
     
    264258void SphereThetaPhi<T>::Limits(int k,double& tetMin,double& tetMax,double& phiMin,double& phiMax)
    265259
    266 //    Retourne les valeurs de theta et phi limitant le pixel d'indice k
     260//   Return values of theta,phi which limit the pixel with  index k
    267261//--
    268262  {
     
    317311int SphereThetaPhi<T>::NbThetaSlices() const
    318312
    319 //    Retourne le nombre de tranches en theta sur la sphere
     313//    Return number of theta-slices on the sphere
    320314//--
    321315{
     
    330324int SphereThetaPhi<T>::NPhi(int kt) const
    331325
    332 //    Retourne le nombre de pixels en phi de la tranche kt
     326//    Return number of pixels in phi-direction of the kt-th slice
    333327//--
    334328{
     
    353347void SphereThetaPhi<T>::Theta(int kt,double& tetMin,double& tetMax)
    354348
    355 //    Retourne les valeurs de theta limitant la tranche kt
     349//    Return  theta values which limit the slice kt
    356350//--
    357351{
     
    385379void SphereThetaPhi<T>::Phi(int kt,int jp,double& phiMin,double& phiMax)
    386380
    387 //    Retourne les valeurs de phi limitant le pixel jp de la tranche kt
     381//   Return values of phi which limit the jp-th pixel of the kt-th slice
    388382//--
    389383{
     
    416410int SphereThetaPhi<T>::Index(int kt,int jp) const
    417411
    418 //    Retourne l'indice du pixel d'indice jp dans la tranche kt
     412//    Return pixel index  with sequence index jp in the slice kt
    419413//--
    420414{
     
    449443void SphereThetaPhi<T>::ThetaPhiIndex(int k,int& kt,int& jp)
    450444
    451 //    Retourne les indices kt et jp du pixel d'indice k
     445//    Return indices kt (theta) and jp (phi) of  pixel with index k
    452446//--
    453447{
     
    477471void  SphereThetaPhi<T>::Pixelize(int m)
    478472
    479 //    effectue le découpage en pixels (m et pet ont la même signification
    480 //    que pour le constructeur)
     473//    achieve the splitting into pixels (m has the same signification
     474//    as for the constructor)
    481475//
    482 //    Chaque bande de theta sera découpée en partant de phi=0 ...
    483 //    L'autre hémisphère est parcourue dans le même sens en phi et de
    484 //    l'équateur vers le pôle (le pixel qui suit le dernier de la bande la plus
    485 //    proche de l'équateur a z>0 est celui de plus petit phi de la bande la
    486 //    plus proche de l'equateur a z<0).
     476//    Each theta-slice of the north hemisphere will be spitted starting f
     477//    from  phi=0 ...
     478//
     479//    South hemisphere is scanned in the same direction according to phi
     480//    and from equator to the pole (the pixel following the last one of
     481//    the slice closest to the equator with z>0, is the pixel with lowest
     482//    phi of the slice closest of the equator with z<0).
    487483//--
    488484{
     
    554550void SphereThetaPhi<T>::GetThetaSlice(int index,double& theta, TVector<double>& phi, TVector<T>& value) const
    555551
    556 //    Retourne, pour la tranche en theta d'indice 'index' le theta
    557 //    correspondant, un vecteur (Peida) contenant les phi des pixels de
    558 //    la tranche, un vecteur (Peida) contenant les valeurs de pixel
    559 //    correspondantes
     552//    For a theta-slice with index 'index', return :
     553//    the corresponding "theta"
     554//    a vector containing the phi's of the pixels of the slice
     555//    a vector containing the corresponding values of pixels
    560556//--
    561557
     
    591587void SphereThetaPhi<T>::setmNPhi(int* array, int m)
    592588  //remplit le tableau contenant le nombre de pixels en phi de chacune des bandes en theta
    593   //--
     589  //
    594590{
    595591  NPhi_= new int[m];
     
    600596void SphereThetaPhi<T>::setmTNphi(int* array, int m)
    601597  //remplit  le tableau contenant le nombre/Deuxpi total des pixels contenus dans les bandes
    602   //--
     598  //
    603599{
    604600  TNphi_= new int[m];
     
    609605void SphereThetaPhi<T>::setmTheta(double* array, int m)
    610606  //remplit  le tableau contenant les valeurs limites de theta
    611   //--
     607  //
    612608{
    613609  Theta_= new double[m];
     
    715711void FIO_SphereThetaPhi<T>::ReadSelf(PInPersist& is)
    716712{
    717   cout << " FIO_SphereThetaPhi:: ReadSelf " << endl;
    718713
    719714  if(dobj == NULL)
     
    772767void FIO_SphereThetaPhi<T>::WriteSelf(POutPersist& os) const
    773768{
    774   cout << " FIO_SphereThetaPhi:: WriteSelf " << endl;
    775769
    776770  if(dobj == NULL)
  • trunk/SophyaLib/Samba/spherethetaphi.h

    r518 r565  
    1010
    1111// ***************** Class SphereThetaPhi *****************************
     12/*!    sphere splitted with respect to theta, phi : each hemisphere is
     13    splitted into (m-1) parallels (equator does not enter into account).
     14   This operation defines m slices, each of which is splitted into
     15    equidistant meridians. This splitting is realized in such a way that
     16    all pixels have the same area and are as square as possible.
    1217
     18    One begins with the hemisphere with positive z, starting from the pole
     19    toward the equator. The first pixel is the polar cap ; it is circular
     20    and centered on theta=0.
     21*/
    1322template <class T>
    1423class SphereThetaPhi : public SphericalMap<T>, public AnyDataObj
     
    1827
    1928SphereThetaPhi();
     29/*!    m is the number of slices in theta on an hemisphere (the polar cap
     30   forms the first slice).
     31    pet is a dummy parameter at the moment.
     32*/
    2033SphereThetaPhi(int m);
    2134SphereThetaPhi(const SphereThetaPhi<T>& s);
     
    2538
    2639/* retourne/fixe le nombre de pixels */
     40/*!    Return total number of pixels  */
    2741virtual int NbPixels() const;
    2842inline void setNbPixels(int nbpix) { NPix_= nbpix; }
    2943
    3044/* retourne la valeur du pixel d'indice k */
     45/*!    Return value of pixel with index k */
    3146virtual T&       PixVal(int k);
    3247virtual T const& PixVal(int k) const;
     
    3550virtual bool ContainsSph(double theta, double phi) const;
    3651/* retourne l'indice du pixel a (theta,phi) */
     52/*    Return index of the pixel corresponding to direction (theta, phi). */
    3753virtual int PixIndexSph(double theta, double phi) const;
    3854
    3955/* retourne les coordonnees Spheriques du centre du pixel d'indice k */
     56/*!   Return (theta,phi) coordinates of middle of  pixel with  index k */
    4057virtual void PixThetaPhi(int k, double& theta, double& phi) const;
    4158
    4259/* retourne/fixe l'angle Solide de Pixel   (steradians) */
     60/*!   Pixel Solid angle  (steradians)
     61
     62    All the pixels have the same solid angle. The dummy argument is
     63   for compatibility with eventual pixelizations which would not
     64    fulfil this requirement.
     65*/
    4366virtual double PixSolAngle(int dummy) const;
    4467inline void setPixSolAngle(double omega) { Omega_= omega; }
     
    5073// ------------- Specific methods  ----------------------
    5174
     75/*!   re-pixelize the sphere */
    5276virtual void Resize(int m);
    5377
     
    5579
    5680/* Valeurs de theta des paralleles et phi des meridiens limitant le pixel d'indice k */
     81/*   Return values of theta,phi which limit the pixel with  index k */
    5782virtual void Limits(int k,double& th1,double& th2,double& phi1,double& phi2);
    5883
    5984/* Nombre de tranches en theta */
     85/*!    Return number of theta-slices on the sphere */
    6086int NbThetaSlices() const;
    6187
     
    6591/* Renvoie dans t1,t2 les valeurs respectives de theta min et theta max  */
    6692/* de la tranche d'indice kt  */
     93/*!    Return  theta values which limit the slice kt */
    6794void Theta(int kt, double& t1, double& t2);
    6895
    6996/* Renvoie dans p1,p2 les valeurs phimin et phimax du pixel d'indice jp  */
    7097/* dans la tranche d'indice kt  */
     98/*!   Return values of phi which limit the jp-th pixel of the kt-th slice */
    7199void Phi(int kt, int jp, double& p1, double& p2);
    72100
    73101/* Renvoie l'indice k du pixel d'indice jp dans la tranche d'indice kt   */
     102/*!   Return pixel index  with sequence index jp in the slice kt */
    74103int Index(int kt, int jp) const;
    75104
    76105/* Indice kt de la tranche et indice jp du pixel d'indice k  */
     106/*!    Return indices kt (theta) and jp (phi) of  pixel with index k */
    77107void ThetaPhiIndex(int k,int& kt,int& jp);
    78108
     109/*!    achieve the splitting into pixels (m has the same signification
     110    as for the constructor)
     111
     112    Each theta-slice of the north hemisphere will be spitted starting f
     113    from  phi=0 ...
     114
     115    South hemisphere is scanned in the same direction according to phi
     116    and from equator to the pole (the pixel following the last one of
     117    the slice closest to the equator with z>0, is the pixel with lowest
     118    phi of the slice closest of the equator with z<0).
     119*/
    79120void Pixelize(int);
    80121
     122/*!   For a theta-slice with index 'index', return :
     123
     124   the corresponding "theta"
     125
     126    a vector containing the phi's of the pixels of the slice
     127
     128    a vector containing the corresponding values of pixels
     129*/
    81130void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const;
    82131
     
    129178virtual AnyDataObj* DataObj();
    130179inline operator SphereThetaPhi<T>() { return(*dobj); }
    131 inline SphereThetaPhi<T> getObj() { return(*dobj); }
     180//inline SphereThetaPhi<T> getObj() { return(*dobj); }
    132181
    133182protected :
  • trunk/SophyaLib/Samba/unitvector.cc

    r262 r565  
    11#include <math.h>
    22#include "unitvector.h"
    3 
     3//*****************************************************************************
     4//++
     5// Class        UnitVector
     6//
     7// include      unitvector.h vector3d.h math.h
     8//--
     9//++
     10//
     11// Links        Parents
     12//
     13//    Vector3d
     14//   
     15//--
     16//++
     17// Titre        Constructors
     18//--
     19//++
    420UnitVector::UnitVector() : Vector3d(1.,0.,0.)
     21//
     22//--
    523{
    624}
    7 
     25//++
    826UnitVector::UnitVector(double x, double y, double z) : Vector3d(x,y,z)
     27//
     28//--
    929{
    1030  this->Normalize();
    1131}
    12 
     32//++
    1333UnitVector::UnitVector(double theta, double phi) : Vector3d(theta,phi)
     34//
     35//--
    1436{
    1537  this->Normalize();
    1638}
    17 
     39//++
    1840UnitVector::UnitVector(const Vector3d& v) : Vector3d(v)
     41//
     42//--
    1943{
    2044  this->Normalize();
    2145}
     46//++
     47// Titre        Public Method
     48//--
     49//++
     50void UnitVector::Print(ostream& os) const
     51//
     52//--
     53{
     54  os << "UnitVector : (X,Y,Z)= (" << _x << ", " << _y << ", " << _z
     55     << ") Theta,Phi= " << _theta << ", " << _phi << "\n"
     56     << "norme =" << this->Norm() << endl;
     57}
     58//++
     59// Titre        Operators
     60//--
     61//++
     62Vector3d& UnitVector::operator = (const Vector3d& v)
     63//
     64//--
    2265
    23 Vector3d& UnitVector::operator=(const Vector3d& v)
    2466{
    2567  Setxyz(v.X(),v.Y(),v.Z());
     
    2769  return *this;
    2870}
    29 
    30 Vector3d& UnitVector::operator+=(const Vector3d& v)
     71//++
     72Vector3d& UnitVector::operator += (const Vector3d& v)
     73//
     74//--
    3175{
    3276  Setxyz(_x+v.X(),_y+v.Y(),_z+v.Z());
     
    3478  return *this;
    3579}
    36 
    37 Vector3d& UnitVector::operator-=(const Vector3d& v)
     80//++
     81Vector3d& UnitVector::operator -= (const Vector3d& v)
     82//
     83//--
    3884{
    3985  Setxyz(_x-v.X(),_y-v.Y(),_z-v.Z());
     
    4187  return *this;
    4288}
    43 
    44 Vector3d UnitVector::operator+(const Vector3d& v) const
     89//++
     90Vector3d UnitVector::operator + (const Vector3d& v) const
     91//
     92//--
    4593{
    4694  return UnitVector(_x+v.X(),_y+v.Y(),_z+v.Z());
    4795}
    48 
    49 Vector3d UnitVector::operator-(const Vector3d& v) const
     96//++
     97Vector3d UnitVector::operator - (const Vector3d& v) const
     98//
     99//--
    50100{
    51101  return UnitVector(_x-v.X(),_y-v.Y(),_z-v.Z());
    52102}
    53 
    54 void UnitVector::Print(ostream& os) const
    55 {
    56   os << "UnitVector : (X,Y,Z)= (" << _x << ", " << _y << ", " << _z
    57      << ") Theta,Phi= " << _theta << ", " << _phi << "\n"
    58      << "norme =" << this->Norm() << endl;
    59 }
  • trunk/SophyaLib/Samba/utilgeom.cc

    r508 r565  
    22#include <iostream.h>
    33#include "utilgeom.h"
    4 
     4//++
     5// Titre        Some utilitary functions for geometry (utilgeom.h)...
     6//--
     7//++
    58int sign(double d)
     9//
     10//--
    611{
    712  return (d >= 0) - (d < 0);
    813}
    9 
     14//++
    1015double absd(double d)
     16//
     17//--
    1118{
    1219  return sqrt(d*d);
    1320}
    14 
     21//++
    1522double mod(double d, double periode)
     23//
     24//--
    1625{
    1726  if( d >= 0 ) return d-floor(d/periode)*periode;
    1827  else return d-ceil(d/periode)*periode+periode;
    1928}
    20 
     29//++
    2130void swap(double& d1, double& d2)
     31//
     32//--
    2233{
    2334  double temp;
     
    2637  d1=temp;
    2738}
    28 
     39//++
    2940double min(double d1, double d2)
     41//
     42//--
    3043{
    3144  if( d1 >= d2 ) return d2;
    3245  else return d1;
    3346}
    34 
     47//++
    3548double max(double d1, double d2)
     49//
     50//--
    3651{
    3752  return -min(-d1,-d2);
    3853}
    39 
     54//++
    4055int arrondi(double d)
     56//
     57//--
    4158{
    4259  return (int)(((d-floor(d)) >= 0.5)*ceil(d)+((d-floor(d)) < 0.5)*floor(d));
    4360}
    44 
     61//++
    4562long rangijd(int nc, int i, int j, int d)
     63//
     64//--
    4665{
    4766  if( i < j ) return 2*i*(2*nc-i-1)+4*(j-i-1)+d;
     
    5574  else return -1;
    5675}
    57 
     76//++
    5877long rangdiff(int nc, int i, int j, int d)
     78//
     79//--
    5980{
    6081  if( i == j )
     
    6889  return indm*(2*nc-indm-1)+2*(indM-indm-1)+d;
    6990}
    70 
     91//++
    7192long rangik(int NtotEch, int i, int k)
     93//
     94//--
    7295{
    7396  return NtotEch*i+k;
    7497}
    75 
     98//++
    7699long ranghk(int NtotEch, int h, int k)
     100//
     101//--
    77102{
    78103  return NtotEch*h+k;
    79104}
    80 
     105//++
    81106double scangle(double sinus, double cosinus)
     107//
     108//--
    82109{
    83110  double eps=1e-10;
  • trunk/SophyaLib/Samba/vector3d.cc

    r264 r565  
    22#include "vector3d.h"
    33#include "utilgeom.h"
    4 
    5 Vector3d::Vector3d()
     4//++
     5// Class        Vector3d
     6//
     7// include      vector3d.h utilgeom.h  longlat.h math.h
     8//
     9//
     10//    3-D geometry.
     11//    All computations are made with angles in radians and with spherical
     12//    coordinates theta, phi.
     13//
     14//    Concerning Euler's angles, the reference is :
     15//
     16//    "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
     17//--
     18//++
     19// Titre        Constructors
     20//--
     21//++
     22Vector3d::Vector3d()
     23//
     24//--
    625{
    726  Setxyz(1.,0.,0.);
    827}
    9 
     28//++
    1029Vector3d::Vector3d(double x, double y, double z)
     30//
     31//--
    1132{
    1233  _x=x;
     
    1536  xyz2ThetaPhi();
    1637}
    17 
     38//++
    1839Vector3d::Vector3d(double theta, double phi)
     40//
     41//--
    1942{
    2043  _theta=mod(theta,M_PI); // dans [0;pi]
     
    2245  ThetaPhi2xyz();
    2346}
    24 
     47//++
    2548Vector3d::Vector3d(const LongLat& ll)
     49//
     50//--
    2651{
    2752  _theta=ll.Theta(); // dans [0;pi]
     
    2954  ThetaPhi2xyz();
    3055}
    31 
     56//++
    3257Vector3d::Vector3d(const Vector3d& v)
     58//
     59//--
    3360{
    3461  _x=v._x;
     
    3865  _phi=v._phi;
    3966}
    40 
    41 void Vector3d::SetThetaPhi(double theta, double phi)
     67//++
     68// Titre        Public methods
     69//--
     70//++
     71void Vector3d::SetThetaPhi(double theta, double phi)
     72//
     73//--
    4274{
    4375  _theta=mod(theta,M_PI);
     
    4577  ThetaPhi2xyz();
    4678}
    47 
     79//++
    4880void Vector3d::Setxyz(double x, double y, double z)
     81//
     82//--
    4983{
    5084  _x=x;
     
    5387  xyz2ThetaPhi();
    5488}
    55 
     89//++
    5690void Vector3d::ThetaPhi2xyz()
     91//
     92//--
    5793{
    5894  _x=sin(_theta)*cos(_phi);
     
    6096  _z=cos(_theta);
    6197}
    62 
     98//++
    6399void Vector3d::xyz2ThetaPhi()
     100//
     101//--
    64102{
    65103  double norm=this->Norm();
     
    77115    }
    78116}
    79 
     117//++
    80118Vector3d& Vector3d::Normalize()
     119//
     120//--
    81121{
    82122  double norm=this->Norm();
     
    85125  return *this;
    86126}
    87 
     127//++
    88128double Vector3d::Norm() const
     129//
     130//--
    89131{
    90132  return sqrt(_x*_x+_y*_y+_z*_z);
    91133}
    92 
     134//++
    93135double Vector3d::Psc(const Vector3d& v) const
     136//
     137//    dot product
     138//--
    94139{
    95140  return _x*v._x+_y*v._y+_z*v._z;
    96141}
    97 
     142//++
    98143double Vector3d::SepAngle(const Vector3d& v) const
     144//
     145//    angular gap between 2 vectors in [0,Pi]
     146//--
    99147{
    100148  double n1=this->Norm();
     
    109157  return ret;
    110158}
    111 
     159//++
    112160Vector3d Vector3d::Vect(const Vector3d& v) const
     161//
     162//    vector product
     163//--
    113164{
    114165  double xo=_y*v._z-_z*v._y;
     
    117168  return Vector3d(xo,yo,zo);
    118169}
    119 
    120 Vector3d Vector3d::VperpPhi() const // vecteur perpendiculaire de meme phi
     170//++
     171Vector3d Vector3d::VperpPhi() const
     172//
     173//    perpendicular vector, with equal phi
     174//--
    121175{
    122176  double theta;
     
    125179  return Vector3d(theta,_phi);
    126180}
    127 
    128 Vector3d Vector3d::VperpTheta() const // vecteur perpendiculaire de meme theta
     181//++
     182Vector3d Vector3d::VperpTheta() const
     183//
     184//    perpendicular vector with equal theta
     185//--
    129186{
    130187  double phi=mod(_phi+pi_over_2,pi2); // on tourne phi de pi/2
     
    147204  return temp;
    148205}
    149 
     206//++
    150207Vector3d Vector3d::ETheta() const
     208//
     209//--
    151210{
    152211  Vector3d temp=this->Vect(EPhi());
     
    155214}
    156215
    157 
     216//++
    158217Vector3d Vector3d::Euler(double phi, double theta, double psi) const
     218//
     219//    Euler's rotations
     220//--
    159221{
    160222  double cpsi=cos(psi);
     
    173235  return Vector3d(xnew,ynew,znew);
    174236}
    175 
     237//++
    176238Vector3d Vector3d::InvEuler(double phi, double theta, double psi) const
     239//
     240//    inverse rotation
     241//--
    177242{
    178243  double cpsi=cos(psi);
     
    191256  return Vector3d(xnew,ynew,znew);
    192257}
    193 
     258//++
    194259Vector3d Vector3d::Rotate(const Vector3d& omega, double phi)
     260//
     261//    rotation of angle phi around an axis omega (Maxwell's rule)
     262//--
    195263{
    196264  Vector3d rotationaxis=omega;
     
    200268  Vector3d rotate=n*rotationaxis+(myself-n*rotationaxis)*cos(phi)-(myself^rotationaxis)*sin(phi);
    201269  return rotate;
    202 }   
    203 
    204 Vector3d& Vector3d::operator+=(const Vector3d& v)
     270}
     271//++ 
     272void Vector3d::Print(ostream& os) const
     273//
     274//--
     275{
     276  os << "Vector3: (X,Y,Z)= (" << _x << ", " << _y << ", " << _z
     277     << ") --- Theta,Phi= " << _theta << ", " << _phi << "\n"
     278     << "Norme = " << this->Norm() << endl;
     279}
     280//++
     281// Titre        Operators
     282//--
     283//++
     284Vector3d& Vector3d::operator += (const Vector3d& v)
     285//
     286//--
    205287{
    206288  *this=*this+v;
    207289  return *this;
    208290}
    209 
    210 Vector3d& Vector3d::operator-=(const Vector3d& v)
     291//++
     292Vector3d& Vector3d::operator -= (const Vector3d& v)
     293//
     294//--
    211295{
    212296  *this=*this-v;
    213297  return *this;
    214298}
    215 
    216 Vector3d& Vector3d::operator+=(double d)
     299//++
     300Vector3d& Vector3d::operator += (double d)
     301//
     302//--
    217303{
    218304  Setxyz(_x+d,_y+d,_z+d);
    219305  return *this;
    220306}
    221 
    222 Vector3d& Vector3d::operator/=(double d)
     307//++
     308Vector3d& Vector3d::operator /= (double d)
     309//
     310//--
    223311{
    224312  if( d != 0. ) Setxyz(_x/d,_y/d,_z/d);
     
    226314  return *this;
    227315}
    228 
    229 Vector3d& Vector3d::operator*=(double d)
     316//++
     317Vector3d& Vector3d::operator *= (double d)
     318//
     319//--
    230320{
    231321  Setxyz(_x*d,_y*d,_z*d);
    232322  return *this;
    233323}
    234 
    235 Vector3d Vector3d::operator^(const Vector3d& v) const
     324//++
     325Vector3d Vector3d::operator ^ (const Vector3d& v) const
     326//
     327//    vector product
     328//--
    236329{
    237330  return this->Vect(v);
    238331}
    239 
    240 Vector3d Vector3d::operator+(double d) const
     332//++
     333Vector3d Vector3d::operator + (double d) const
     334//
     335//--
    241336{
    242337  return Vector3d(_x+d,_y+d,_z+d);
    243338}
    244 
    245 Vector3d Vector3d::operator+(const Vector3d& v) const
     339//++
     340Vector3d Vector3d::operator + (const Vector3d& v) const
     341//
     342//--
    246343{
    247344  return Vector3d(_x+v._x,_y+v._y,_z+v._z);
    248345}
    249 
    250 Vector3d Vector3d::operator-(double d) const
     346//++
     347Vector3d Vector3d::operator - (double d) const
     348//
     349//--
    251350{
    252351  return *this+(-d);
    253352}
    254 
    255 Vector3d Vector3d::operator-(const Vector3d& v) const
     353//++
     354Vector3d Vector3d::operator - (const Vector3d& v) const
     355//
     356//--
    256357{
    257358  return *this+(v*(-1.));
    258359}
    259 
    260 Vector3d Vector3d::operator*(double d) const
     360//++
     361Vector3d Vector3d::operator * (double d) const
     362//
     363//--
    261364{
    262365  return Vector3d(d*_x,d*_y,d*_z);
    263366}
    264 
    265 double Vector3d::operator*(const Vector3d& v) const
     367//++
     368double Vector3d::operator * (const Vector3d& v) const
     369//
     370//    dot product
     371//--
    266372{
    267373  return this->Psc(v);
    268374}
    269 
    270 Vector3d Vector3d::operator/(double d) const
     375//++
     376Vector3d Vector3d::operator / (double d) const
     377//
     378//--
    271379{
    272380  Vector3d ret=*this;
     
    275383  return ret;
    276384}
    277 
    278 Vector3d& Vector3d::operator=(const Vector3d& v)
     385//++
     386Vector3d& Vector3d::operator = (const Vector3d& v)
     387//
     388//--
    279389{
    280390  if( this != &v )
     
    288398  return *this;
    289399}
     400//++
     401bool Vector3d::operator == (const Vector3d& v)
     402//
     403//--
     404{
     405  return (this==&v);
     406}
    290407
    291 bool Vector3d::operator==(const Vector3d& v)
    292 {
    293   return (this==&v);
    294 }
    295 
    296 void Vector3d::Print(ostream& os) const
    297 {
    298   os << "Vector3: (X,Y,Z)= (" << _x << ", " << _y << ", " << _z
    299      << ") --- Theta,Phi= " << _theta << ", " << _phi << "\n"
    300      << "Norme = " << this->Norm() << endl;
    301 }
  • trunk/SophyaLib/Samba/vector3d.h

    r518 r565  
    1818  pour les rotations (angles d'Euler) ma source est
    1919  "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
     20*/
     21/*!    3-D geometry.
     22
     23    All computations are made with angles in radians and with spherical
     24    coordinates theta, phi.
     25
     26    Concerning Euler's angles, the reference is :
     27 
     28    "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
    2029*/
    2130
     
    5160
    5261  // ecart angulaire entre 2 vecteurs dans [0,Pi]
     62  /*!   angular gap between 2 vectors in [0,Pi] */
    5363  virtual double SepAngle(const Vector3d&) const;
    5464
    5565  // produit vectoriel
     66  /*!    vector product */
    5667  virtual Vector3d Vect(const Vector3d&) const;
    5768
    5869  // vecteur perpendiculaire de meme phi
     70  /*!    perpendicular vector, with equal phi */
    5971  virtual Vector3d VperpPhi() const;
    6072
    6173  // vecteur perpendiculaire de meme theta
     74  /*!    perpendicular vector with equal theta */
    6275  virtual Vector3d VperpTheta() const;
    6376
     
    6578  virtual Vector3d EPhi() const;
    6679
     80  // rotations d'Euler
     81  /*!    Euler's rotations */
    6782  // rotations d Euler
    6883  virtual Vector3d Euler(double, double, double) const;
    6984
    7085  // rotation inverse
     86  /*!    inverse rotation */
    7187  Vector3d InvEuler(double, double, double) const;
    7288
    73   // rotation d angle phi autour d'un axe omega (regle du tire-bouchon)
     89  // rotation d'angle phi autour d'un axe omega (regle du tire-bouchon)
     90  /*!    rotation of angle phi around an axis omega (Maxwell's rule) */
    7491  Vector3d Rotate(const Vector3d& omega,double phi);
    7592
     
    89106  virtual Vector3d operator/(double) const;
    90107
     108  /*!    vector product */
    91109  virtual Vector3d operator^(const Vector3d&) const; // produit vectoriel
     110  /*!    dot product */
    92111  virtual double operator*(const Vector3d&) const; // produit scalaire
    93112
Note: See TracChangeset for help on using the changeset viewer.