Changeset 565 in Sophya
- Timestamp:
- Nov 10, 1999, 3:01:46 PM (26 years ago)
- Location:
- trunk/SophyaLib/Samba
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/scan.h
r228 r565 7 7 #include <iostream.h> 8 8 #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) 10 11 12 class Scan : public AnyDataObj { 13 // friend FIO_Scan; 11 14 public : 12 15 /* … … 22 25 . offset d'antenne en angle phi 23 26 */ 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 */ 24 39 Scan(float,float*,float,float,float,float); 25 40 Scan(const Scan& ); 26 41 Scan() { 27 42 InitNull(); 28 cout << " constructeur de scan par defaut" << endl;29 43 } 30 44 ~Scan(); … … 32 46 // ------------ Persistence handling 33 47 34 enum {classId = 0xF003 };35 int_4 ClassId() const { return classId; }48 // enum {classId = 0xF003 }; 49 //int_4 ClassId() const { return classId; } 36 50 37 virtual void WriteSelf(POutPersist&) const;38 virtual void ReadSelf(PInPersist&);51 //virtual void WriteSelf(POutPersist&) const; 52 //virtual void ReadSelf(PInPersist&); 39 53 54 /*! Return the number of points in the scan */ 40 55 int_4 NbPoints() const; 56 /*! Return total nomber of turns */ 41 57 int_4 NbTours() const; 58 /*! Return nomber of points for 1 turn */ 42 59 int_4 NbPts1Tr() const; 60 /*! Return index of pixel associated to time t */ 43 61 int_4 ValueIndex(float) const; 62 /*! Return (teta,phi) coordinate of pixel related to time t */ 44 63 void Direction(float, float& ,float& ); 64 /*! Return (teta,phi) coordinates of pixel with index k */ 45 65 void DirectionIndex(int_4,float& ,float& ); 46 double& PixelValue(int_4 k) const; 66 /*! Return value of pixel with index k */ 67 r_8 & PixelValue(int_4 k) ; 68 /*! const version of previous method */ 69 r_8 const & PixelValue(int_4 k) const; 47 70 48 71 /* Surcharge de la parenthese a un indice entier : remplit ou/et renvoie */ 49 72 /* 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) 52 75 { return(PixelValue(k)) ; } ; 76 inline r_8 const & operator()(int_4 k) const 77 { return(PixelValue(k)) ; } ; 78 Scan& operator = (const Scan& s); 53 79 //++ 54 80 DVList& Info() … … 56 82 // Renvoie une reference sur l'objet DVList Associe 57 83 //-- 58 { 84 { 59 85 if (mInfo_ == NULL) mInfo_ = new DVList; 60 86 return(*mInfo_); 61 87 } 62 88 89 const DVList* ptrInfo() const 90 { 91 return mInfo_; 92 } 93 94 95 96 inline 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 */ 133 inline const NDataBlock<r_8>* getDataBlock() const {return (&sPix_);} 134 inline void setDataBlock(r_8* data, int n) {sPix_.FillFrom(n,data);} 63 135 64 136 private : 65 137 66 void Clear();138 //void Clear(); 67 139 void InitNull(); 68 140 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] */ 82 156 /* Xs : coordonnees dans un systeme lie au satellite*/ 83 157 /* 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 164 class FIO_Scan : public PPersist 165 { 166 167 public: 168 169 FIO_Scan(); 170 FIO_Scan(string const & filename); 171 FIO_Scan(const Scan& obj); 172 FIO_Scan(Scan* obj); 173 virtual ~FIO_Scan(); 174 virtual AnyDataObj* DataObj(); 175 inline operator Scan() {return(*dobj); } 176 177 protected : 178 179 virtual void ReadSelf(PInPersist&); 180 virtual void WriteSelf(POutPersist&) const; 181 Scan* dobj; 182 bool ownobj; 85 183 }; 86 184 -
trunk/SophyaLib/Samba/spheregorski.cc
r518 r565 158 158 // to phi = 0 159 159 // 160 // nside DOIT OBLIGATOIREMENT ETRE UNE PUISSANCE DE2 (<= 8192)160 // nside MUST be a power of 2 (<= 8192) 161 161 //-- 162 162 //++ … … 166 166 // SphericalMap 167 167 //-- 168 //++169 //170 // Links Descendants171 //172 //173 //--174 168 175 169 /* --Methode-- */ 176 170 //++ 177 // Titre Construct eurs171 // Titre Constructors 178 172 //-- 179 173 //++ … … 191 185 SphereGorski<T>::SphereGorski(int m) 192 186 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) 196 192 //-- 197 193 { … … 213 209 Pixelize(m); 214 210 } 215 211 //++ 216 212 template<class T> 217 213 SphereGorski<T>::SphereGorski(const SphereGorski<T>& s) 214 215 // copy constructor 216 //-- 218 217 { 219 218 cout << " constructeur de recopie " << endl; … … 229 228 230 229 //++ 231 // Titre Destruct eur230 // Titre Destructor 232 231 //-- 233 232 //++ … … 241 240 242 241 //++ 243 // Titre Méthodes242 // Titre Public Methods 244 243 //-- 245 244 … … 248 247 void SphereGorski<T>::Resize(int m) 249 248 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) 253 254 //-- 254 255 { … … 276 277 // 277 278 // 278 //--279 279 { 280 280 // On memorise les arguments d'appel … … 325 325 int SphereGorski<T>::NbThetaSlices() const 326 326 327 // Ret ourne le nombre de tranches en theta sur lasphere327 // Return number of slices in theta direction on the sphere 328 328 //-- 329 329 { … … 335 335 void SphereGorski<T>::GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const 336 336 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 // 341 345 //-- 342 346 { … … 387 391 T& SphereGorski<T>::PixVal(int k) 388 392 389 // Ret ourne la valeur du contenu du pixel d'indice "RING"k393 // Return value of pixel with "RING" index k 390 394 //-- 391 395 { … … 404 408 T const& SphereGorski<T>::PixVal(int k) const 405 409 406 // Ret ourne la valeur du contenu du pixel d'indice "RING"k410 // Return value of pixel with "RING" index k 407 411 //-- 408 412 { … … 420 424 T& SphereGorski<T>::PixValNest(int k) 421 425 422 // Ret ourne la valeur du contenu du pixel d'indice "NESTED"k426 // Return value of pixel with "NESTED" index k 423 427 //-- 424 428 { … … 436 440 T const& SphereGorski<T>::PixValNest(int k) const 437 441 438 // Ret ourne la valeur du contenu du pixel d'indice "NESTED"k442 // Return value of pixel with "NESTED" index k 439 443 //-- 440 444 { … … 463 467 int SphereGorski<T>::PixIndexSph(double theta,double phi) const 464 468 465 // Ret ourne l'indice "RING" du pixel vers lequel pointe une direction466 // d éfinie par ses coordonnées sphériques469 // Return "RING" index of the pixel corresponding to 470 // direction (theta, phi). 467 471 //-- 468 472 { … … 474 478 int SphereGorski<T>::PixIndexSphNest(double theta,double phi) const 475 479 476 // Ret ourne l'indice NESTED" du pixel vers lequel pointe une direction477 // d éfinie par ses coordonnées sphériques480 // Return "NESTED" index of the pixel corresponding to 481 // direction (theta, phi). 478 482 //-- 479 483 { … … 487 491 void SphereGorski<T>::PixThetaPhi(int k,double& theta,double& phi) const 488 492 489 // Ret ourne les coordonnées (theta,phi) du milieu du pixel d'indice "RING"k493 // Return (theta,phi) coordinates of middle of pixel with "RING" index k 490 494 //-- 491 495 { … … 509 513 void SphereGorski<T>::PixThetaPhiNest(int k,double& theta,double& phi) const 510 514 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 513 516 //-- 514 517 { … … 520 523 int SphereGorski<T>::NestToRing(int k) const 521 524 522 // conversion d'index NESTD en un index RING525 // translation from NESTED index into RING index 523 526 // 524 527 //-- … … 531 534 int SphereGorski<T>::RingToNest(int k) const 532 535 // 533 // conversion d'index RING en un index NESTED536 // translation from RING index into NESTED index 534 537 // 535 538 //-- … … 1140 1143 void FIO_SphereGorski<T>::ReadSelf(PInPersist& is) 1141 1144 { 1142 cout << " FIO_SphereGorski:: ReadSelf " << endl;1143 1145 1144 1146 if(dobj == NULL) … … 1183 1185 void FIO_SphereGorski<T>::WriteSelf(POutPersist& os) const 1184 1186 { 1185 cout << " FIO_SphereGorski:: WriteSelf " << endl;1186 1187 1187 1188 if(dobj == NULL) -
trunk/SophyaLib/Samba/spheregorski.h
r518 r565 12 12 // ***************** CLASSE SphereGorski ***************************** 13 13 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 14 52 template<class T> 15 53 class SphereGorski : public SphericalMap<T>, public AnyDataObj … … 19 57 20 58 SphereGorski(); 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 */ 21 66 SphereGorski(int m); 22 67 SphereGorski(const SphereGorski<T>& s); 68 //! Destructor 23 69 virtual ~SphereGorski(); 24 70 … … 26 72 27 73 /* Nombre de pixels du decoupage */ 74 /*! Return number of pixels of the splitting */ 28 75 virtual int NbPixels() const; 29 76 inline void setNbPixels(int n) {nPix_= n;} 30 77 31 78 /* Valeur du contenu du pixel d'indice "RING" k */ 79 /*! Return value of pixel with "RING" index k */ 32 80 virtual T& PixVal(int k); 33 81 virtual T const& PixVal(int k) const; 34 82 35 83 /* Nombre de tranches en theta */ 84 /*! Return number of slices in theta direction on the sphere */ 36 85 int 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 */ 37 94 void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const; 38 95 … … 41 98 /* Indice "RING" du pixel vers lequel pointe une direction definie par 42 99 ses coordonnees spheriques */ 100 /*! Return "RING" index of the pixel corresponding to direction (theta, phi). 101 */ 43 102 virtual int PixIndexSph(double theta,double phi) const; 44 103 … … 47 106 48 107 /* 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 */ 49 114 virtual double PixSolAngle(int dummy) const; 50 115 inline void setPixSolAngle(double x) {omeg_= x;} … … 52 117 // --------------- Specific methods 53 118 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 */ 54 126 virtual void Resize(int m); 55 127 … … 57 129 58 130 /* Valeur du contenu du pixel d'indice "NEST" k */ 131 /*! Return value of pixel with "NESTED" index k */ 59 132 virtual T& PixValNest(int k); 133 /*! Return value of pixel with "NESTED" index k */ 60 134 virtual T const& PixValNest(int k) const; 61 135 62 136 /* Indice "NEST" du pixel vers lequel pointe une direction definie par 63 137 ses coordonnees spheriques */ 138 /*! Return "NESTED" index of the pixel corresponding to direction (theta, phi). 139 */ 64 140 virtual int PixIndexSphNest(double theta,double phi) const; 65 141 66 142 /* Coordonnees spheriques du milieu du pixel d'indice "NEST" k */ 143 /*! Return (theta,phi) coordinates of middle of pixel with "NESTED" index k 144 */ 67 145 virtual void PixThetaPhiNest(int k,double& theta,double& phi) const; 68 146 … … 71 149 72 150 /* convertit index nested en ring */ 151 /*! translation from NESTED index into RING index */ 73 152 int NestToRing(int) const; 74 153 75 154 /* convertit index ring en nested" */ 155 /*! translation from RING index into NESTED index */ 76 156 int RingToNest(int) const; 77 157 … … 127 207 virtual AnyDataObj* DataObj(); 128 208 inline operator SphereGorski<T>() { return(*dobj); } 129 inline SphereGorski<T> getObj() { return(*dobj); }209 //inline SphereGorski<T> getObj() { return(*dobj); } 130 210 131 211 protected : -
trunk/SophyaLib/Samba/spherethetaphi.cc
r518 r565 13 13 // include spherethetaphi.h nbmath.h 14 14 // 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. 23 24 //-- 24 25 //++ … … 28 29 // SphericalMap 29 30 //-- 30 //++ 31 // 32 // Links Descendants 33 // 34 // 35 //-- 36 37 /* --Methode-- */ 38 //++ 39 // Titre Constructeurs 31 32 /* --Methode-- */ 33 //++ 34 // Titre Constructors 40 35 //-- 41 36 //++ … … 56 51 SphereThetaPhi<T>::SphereThetaPhi(int m) 57 52 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. 62 56 //-- 63 57 { … … 88 82 89 83 //++ 90 // Titre Destruct eur84 // Titre Destructor 91 85 //-- 92 86 //++ … … 100 94 101 95 //++ 102 // Titre Méthodes96 // Titre Public Méthods 103 97 //-- 104 98 template <class T> … … 141 135 int SphereThetaPhi<T>::NbPixels() const 142 136 143 // Ret ourne le nombre de pixels du découpage137 // Return total number of pixels 144 138 //-- 145 139 { … … 152 146 T& SphereThetaPhi<T>::PixVal(int k) 153 147 154 // Ret ourne la valeur du contenu du pixel d'indicek148 // Return value of pixel with index k 155 149 //-- 156 150 { … … 168 162 T const& SphereThetaPhi<T>::PixVal(int k) const 169 163 170 // Ret ourne la valeur du contenu du pixel d'indicek164 // Return value of pixel with index k 171 165 //-- 172 166 { … … 194 188 int SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const 195 189 196 // Retourne l'indice du pixel vers lequel pointe une direction définie par197 // ses coordonnées sphériques190 // Return index of the pixel corresponding to 191 // direction (theta, phi). 198 192 //-- 199 193 { … … 223 217 void SphereThetaPhi<T>::PixThetaPhi(int k,double& theta,double& phi) const 224 218 225 // Retourne les coordonnées (theta,phi) du milieu du pixel d'indicek219 // Return (theta,phi) coordinates of middle of pixel with index k 226 220 //-- 227 221 { … … 264 258 void SphereThetaPhi<T>::Limits(int k,double& tetMin,double& tetMax,double& phiMin,double& phiMax) 265 259 266 // Retourne les valeurs de theta et phi limitant le pixel d'indicek260 // Return values of theta,phi which limit the pixel with index k 267 261 //-- 268 262 { … … 317 311 int SphereThetaPhi<T>::NbThetaSlices() const 318 312 319 // Ret ourne le nombre de tranches en theta sur lasphere313 // Return number of theta-slices on the sphere 320 314 //-- 321 315 { … … 330 324 int SphereThetaPhi<T>::NPhi(int kt) const 331 325 332 // Ret ourne le nombre de pixels en phi de la tranche kt326 // Return number of pixels in phi-direction of the kt-th slice 333 327 //-- 334 328 { … … 353 347 void SphereThetaPhi<T>::Theta(int kt,double& tetMin,double& tetMax) 354 348 355 // Ret ourne les valeurs de theta limitant la tranche kt349 // Return theta values which limit the slice kt 356 350 //-- 357 351 { … … 385 379 void SphereThetaPhi<T>::Phi(int kt,int jp,double& phiMin,double& phiMax) 386 380 387 // Retourne les valeurs de phi limitant le pixel jp de la tranche kt381 // Return values of phi which limit the jp-th pixel of the kt-th slice 388 382 //-- 389 383 { … … 416 410 int SphereThetaPhi<T>::Index(int kt,int jp) const 417 411 418 // Ret ourne l'indice du pixel d'indice jp dans la tranche kt412 // Return pixel index with sequence index jp in the slice kt 419 413 //-- 420 414 { … … 449 443 void SphereThetaPhi<T>::ThetaPhiIndex(int k,int& kt,int& jp) 450 444 451 // Ret ourne les indices kt et jp du pixel d'indicek445 // Return indices kt (theta) and jp (phi) of pixel with index k 452 446 //-- 453 447 { … … 477 471 void SphereThetaPhi<T>::Pixelize(int m) 478 472 479 // effectue le découpage en pixels (m et pet ont la même signification480 // que pour le constructeur)473 // achieve the splitting into pixels (m has the same signification 474 // as for the constructor) 481 475 // 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). 487 483 //-- 488 484 { … … 554 550 void SphereThetaPhi<T>::GetThetaSlice(int index,double& theta, TVector<double>& phi, TVector<T>& value) const 555 551 556 // Retourne, pour la tranche en theta d'indice 'index' le theta557 // correspondant, un vecteur (Peida) contenant les phi des pixels de558 // la tranche, un vecteur (Peida) contenant les valeurs de pixel559 // correspondantes552 // 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 560 556 //-- 561 557 … … 591 587 void SphereThetaPhi<T>::setmNPhi(int* array, int m) 592 588 //remplit le tableau contenant le nombre de pixels en phi de chacune des bandes en theta 593 // --589 // 594 590 { 595 591 NPhi_= new int[m]; … … 600 596 void SphereThetaPhi<T>::setmTNphi(int* array, int m) 601 597 //remplit le tableau contenant le nombre/Deuxpi total des pixels contenus dans les bandes 602 // --598 // 603 599 { 604 600 TNphi_= new int[m]; … … 609 605 void SphereThetaPhi<T>::setmTheta(double* array, int m) 610 606 //remplit le tableau contenant les valeurs limites de theta 611 // --607 // 612 608 { 613 609 Theta_= new double[m]; … … 715 711 void FIO_SphereThetaPhi<T>::ReadSelf(PInPersist& is) 716 712 { 717 cout << " FIO_SphereThetaPhi:: ReadSelf " << endl;718 713 719 714 if(dobj == NULL) … … 772 767 void FIO_SphereThetaPhi<T>::WriteSelf(POutPersist& os) const 773 768 { 774 cout << " FIO_SphereThetaPhi:: WriteSelf " << endl;775 769 776 770 if(dobj == NULL) -
trunk/SophyaLib/Samba/spherethetaphi.h
r518 r565 10 10 11 11 // ***************** 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. 12 17 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 */ 13 22 template <class T> 14 23 class SphereThetaPhi : public SphericalMap<T>, public AnyDataObj … … 18 27 19 28 SphereThetaPhi(); 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 */ 20 33 SphereThetaPhi(int m); 21 34 SphereThetaPhi(const SphereThetaPhi<T>& s); … … 25 38 26 39 /* retourne/fixe le nombre de pixels */ 40 /*! Return total number of pixels */ 27 41 virtual int NbPixels() const; 28 42 inline void setNbPixels(int nbpix) { NPix_= nbpix; } 29 43 30 44 /* retourne la valeur du pixel d'indice k */ 45 /*! Return value of pixel with index k */ 31 46 virtual T& PixVal(int k); 32 47 virtual T const& PixVal(int k) const; … … 35 50 virtual bool ContainsSph(double theta, double phi) const; 36 51 /* retourne l'indice du pixel a (theta,phi) */ 52 /* Return index of the pixel corresponding to direction (theta, phi). */ 37 53 virtual int PixIndexSph(double theta, double phi) const; 38 54 39 55 /* retourne les coordonnees Spheriques du centre du pixel d'indice k */ 56 /*! Return (theta,phi) coordinates of middle of pixel with index k */ 40 57 virtual void PixThetaPhi(int k, double& theta, double& phi) const; 41 58 42 59 /* 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 */ 43 66 virtual double PixSolAngle(int dummy) const; 44 67 inline void setPixSolAngle(double omega) { Omega_= omega; } … … 50 73 // ------------- Specific methods ---------------------- 51 74 75 /*! re-pixelize the sphere */ 52 76 virtual void Resize(int m); 53 77 … … 55 79 56 80 /* 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 */ 57 82 virtual void Limits(int k,double& th1,double& th2,double& phi1,double& phi2); 58 83 59 84 /* Nombre de tranches en theta */ 85 /*! Return number of theta-slices on the sphere */ 60 86 int NbThetaSlices() const; 61 87 … … 65 91 /* Renvoie dans t1,t2 les valeurs respectives de theta min et theta max */ 66 92 /* de la tranche d'indice kt */ 93 /*! Return theta values which limit the slice kt */ 67 94 void Theta(int kt, double& t1, double& t2); 68 95 69 96 /* Renvoie dans p1,p2 les valeurs phimin et phimax du pixel d'indice jp */ 70 97 /* dans la tranche d'indice kt */ 98 /*! Return values of phi which limit the jp-th pixel of the kt-th slice */ 71 99 void Phi(int kt, int jp, double& p1, double& p2); 72 100 73 101 /* 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 */ 74 103 int Index(int kt, int jp) const; 75 104 76 105 /* 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 */ 77 107 void ThetaPhiIndex(int k,int& kt,int& jp); 78 108 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 */ 79 120 void Pixelize(int); 80 121 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 */ 81 130 void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const; 82 131 … … 129 178 virtual AnyDataObj* DataObj(); 130 179 inline operator SphereThetaPhi<T>() { return(*dobj); } 131 inline SphereThetaPhi<T> getObj() { return(*dobj); }180 //inline SphereThetaPhi<T> getObj() { return(*dobj); } 132 181 133 182 protected : -
trunk/SophyaLib/Samba/unitvector.cc
r262 r565 1 1 #include <math.h> 2 2 #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 //++ 4 20 UnitVector::UnitVector() : Vector3d(1.,0.,0.) 21 // 22 //-- 5 23 { 6 24 } 7 25 //++ 8 26 UnitVector::UnitVector(double x, double y, double z) : Vector3d(x,y,z) 27 // 28 //-- 9 29 { 10 30 this->Normalize(); 11 31 } 12 32 //++ 13 33 UnitVector::UnitVector(double theta, double phi) : Vector3d(theta,phi) 34 // 35 //-- 14 36 { 15 37 this->Normalize(); 16 38 } 17 39 //++ 18 40 UnitVector::UnitVector(const Vector3d& v) : Vector3d(v) 41 // 42 //-- 19 43 { 20 44 this->Normalize(); 21 45 } 46 //++ 47 // Titre Public Method 48 //-- 49 //++ 50 void 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 //++ 62 Vector3d& UnitVector::operator = (const Vector3d& v) 63 // 64 //-- 22 65 23 Vector3d& UnitVector::operator=(const Vector3d& v)24 66 { 25 67 Setxyz(v.X(),v.Y(),v.Z()); … … 27 69 return *this; 28 70 } 29 30 Vector3d& UnitVector::operator+=(const Vector3d& v) 71 //++ 72 Vector3d& UnitVector::operator += (const Vector3d& v) 73 // 74 //-- 31 75 { 32 76 Setxyz(_x+v.X(),_y+v.Y(),_z+v.Z()); … … 34 78 return *this; 35 79 } 36 37 Vector3d& UnitVector::operator-=(const Vector3d& v) 80 //++ 81 Vector3d& UnitVector::operator -= (const Vector3d& v) 82 // 83 //-- 38 84 { 39 85 Setxyz(_x-v.X(),_y-v.Y(),_z-v.Z()); … … 41 87 return *this; 42 88 } 43 44 Vector3d UnitVector::operator+(const Vector3d& v) const 89 //++ 90 Vector3d UnitVector::operator + (const Vector3d& v) const 91 // 92 //-- 45 93 { 46 94 return UnitVector(_x+v.X(),_y+v.Y(),_z+v.Z()); 47 95 } 48 49 Vector3d UnitVector::operator-(const Vector3d& v) const 96 //++ 97 Vector3d UnitVector::operator - (const Vector3d& v) const 98 // 99 //-- 50 100 { 51 101 return UnitVector(_x-v.X(),_y-v.Y(),_z-v.Z()); 52 102 } 53 54 void UnitVector::Print(ostream& os) const55 {56 os << "UnitVector : (X,Y,Z)= (" << _x << ", " << _y << ", " << _z57 << ") Theta,Phi= " << _theta << ", " << _phi << "\n"58 << "norme =" << this->Norm() << endl;59 } -
trunk/SophyaLib/Samba/utilgeom.cc
r508 r565 2 2 #include <iostream.h> 3 3 #include "utilgeom.h" 4 4 //++ 5 // Titre Some utilitary functions for geometry (utilgeom.h)... 6 //-- 7 //++ 5 8 int sign(double d) 9 // 10 //-- 6 11 { 7 12 return (d >= 0) - (d < 0); 8 13 } 9 14 //++ 10 15 double absd(double d) 16 // 17 //-- 11 18 { 12 19 return sqrt(d*d); 13 20 } 14 21 //++ 15 22 double mod(double d, double periode) 23 // 24 //-- 16 25 { 17 26 if( d >= 0 ) return d-floor(d/periode)*periode; 18 27 else return d-ceil(d/periode)*periode+periode; 19 28 } 20 29 //++ 21 30 void swap(double& d1, double& d2) 31 // 32 //-- 22 33 { 23 34 double temp; … … 26 37 d1=temp; 27 38 } 28 39 //++ 29 40 double min(double d1, double d2) 41 // 42 //-- 30 43 { 31 44 if( d1 >= d2 ) return d2; 32 45 else return d1; 33 46 } 34 47 //++ 35 48 double max(double d1, double d2) 49 // 50 //-- 36 51 { 37 52 return -min(-d1,-d2); 38 53 } 39 54 //++ 40 55 int arrondi(double d) 56 // 57 //-- 41 58 { 42 59 return (int)(((d-floor(d)) >= 0.5)*ceil(d)+((d-floor(d)) < 0.5)*floor(d)); 43 60 } 44 61 //++ 45 62 long rangijd(int nc, int i, int j, int d) 63 // 64 //-- 46 65 { 47 66 if( i < j ) return 2*i*(2*nc-i-1)+4*(j-i-1)+d; … … 55 74 else return -1; 56 75 } 57 76 //++ 58 77 long rangdiff(int nc, int i, int j, int d) 78 // 79 //-- 59 80 { 60 81 if( i == j ) … … 68 89 return indm*(2*nc-indm-1)+2*(indM-indm-1)+d; 69 90 } 70 91 //++ 71 92 long rangik(int NtotEch, int i, int k) 93 // 94 //-- 72 95 { 73 96 return NtotEch*i+k; 74 97 } 75 98 //++ 76 99 long ranghk(int NtotEch, int h, int k) 100 // 101 //-- 77 102 { 78 103 return NtotEch*h+k; 79 104 } 80 105 //++ 81 106 double scangle(double sinus, double cosinus) 107 // 108 //-- 82 109 { 83 110 double eps=1e-10; -
trunk/SophyaLib/Samba/vector3d.cc
r264 r565 2 2 #include "vector3d.h" 3 3 #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 //++ 22 Vector3d::Vector3d() 23 // 24 //-- 6 25 { 7 26 Setxyz(1.,0.,0.); 8 27 } 9 28 //++ 10 29 Vector3d::Vector3d(double x, double y, double z) 30 // 31 //-- 11 32 { 12 33 _x=x; … … 15 36 xyz2ThetaPhi(); 16 37 } 17 38 //++ 18 39 Vector3d::Vector3d(double theta, double phi) 40 // 41 //-- 19 42 { 20 43 _theta=mod(theta,M_PI); // dans [0;pi] … … 22 45 ThetaPhi2xyz(); 23 46 } 24 47 //++ 25 48 Vector3d::Vector3d(const LongLat& ll) 49 // 50 //-- 26 51 { 27 52 _theta=ll.Theta(); // dans [0;pi] … … 29 54 ThetaPhi2xyz(); 30 55 } 31 56 //++ 32 57 Vector3d::Vector3d(const Vector3d& v) 58 // 59 //-- 33 60 { 34 61 _x=v._x; … … 38 65 _phi=v._phi; 39 66 } 40 41 void Vector3d::SetThetaPhi(double theta, double phi) 67 //++ 68 // Titre Public methods 69 //-- 70 //++ 71 void Vector3d::SetThetaPhi(double theta, double phi) 72 // 73 //-- 42 74 { 43 75 _theta=mod(theta,M_PI); … … 45 77 ThetaPhi2xyz(); 46 78 } 47 79 //++ 48 80 void Vector3d::Setxyz(double x, double y, double z) 81 // 82 //-- 49 83 { 50 84 _x=x; … … 53 87 xyz2ThetaPhi(); 54 88 } 55 89 //++ 56 90 void Vector3d::ThetaPhi2xyz() 91 // 92 //-- 57 93 { 58 94 _x=sin(_theta)*cos(_phi); … … 60 96 _z=cos(_theta); 61 97 } 62 98 //++ 63 99 void Vector3d::xyz2ThetaPhi() 100 // 101 //-- 64 102 { 65 103 double norm=this->Norm(); … … 77 115 } 78 116 } 79 117 //++ 80 118 Vector3d& Vector3d::Normalize() 119 // 120 //-- 81 121 { 82 122 double norm=this->Norm(); … … 85 125 return *this; 86 126 } 87 127 //++ 88 128 double Vector3d::Norm() const 129 // 130 //-- 89 131 { 90 132 return sqrt(_x*_x+_y*_y+_z*_z); 91 133 } 92 134 //++ 93 135 double Vector3d::Psc(const Vector3d& v) const 136 // 137 // dot product 138 //-- 94 139 { 95 140 return _x*v._x+_y*v._y+_z*v._z; 96 141 } 97 142 //++ 98 143 double Vector3d::SepAngle(const Vector3d& v) const 144 // 145 // angular gap between 2 vectors in [0,Pi] 146 //-- 99 147 { 100 148 double n1=this->Norm(); … … 109 157 return ret; 110 158 } 111 159 //++ 112 160 Vector3d Vector3d::Vect(const Vector3d& v) const 161 // 162 // vector product 163 //-- 113 164 { 114 165 double xo=_y*v._z-_z*v._y; … … 117 168 return Vector3d(xo,yo,zo); 118 169 } 119 120 Vector3d Vector3d::VperpPhi() const // vecteur perpendiculaire de meme phi 170 //++ 171 Vector3d Vector3d::VperpPhi() const 172 // 173 // perpendicular vector, with equal phi 174 //-- 121 175 { 122 176 double theta; … … 125 179 return Vector3d(theta,_phi); 126 180 } 127 128 Vector3d Vector3d::VperpTheta() const // vecteur perpendiculaire de meme theta 181 //++ 182 Vector3d Vector3d::VperpTheta() const 183 // 184 // perpendicular vector with equal theta 185 //-- 129 186 { 130 187 double phi=mod(_phi+pi_over_2,pi2); // on tourne phi de pi/2 … … 147 204 return temp; 148 205 } 149 206 //++ 150 207 Vector3d Vector3d::ETheta() const 208 // 209 //-- 151 210 { 152 211 Vector3d temp=this->Vect(EPhi()); … … 155 214 } 156 215 157 216 //++ 158 217 Vector3d Vector3d::Euler(double phi, double theta, double psi) const 218 // 219 // Euler's rotations 220 //-- 159 221 { 160 222 double cpsi=cos(psi); … … 173 235 return Vector3d(xnew,ynew,znew); 174 236 } 175 237 //++ 176 238 Vector3d Vector3d::InvEuler(double phi, double theta, double psi) const 239 // 240 // inverse rotation 241 //-- 177 242 { 178 243 double cpsi=cos(psi); … … 191 256 return Vector3d(xnew,ynew,znew); 192 257 } 193 258 //++ 194 259 Vector3d Vector3d::Rotate(const Vector3d& omega, double phi) 260 // 261 // rotation of angle phi around an axis omega (Maxwell's rule) 262 //-- 195 263 { 196 264 Vector3d rotationaxis=omega; … … 200 268 Vector3d rotate=n*rotationaxis+(myself-n*rotationaxis)*cos(phi)-(myself^rotationaxis)*sin(phi); 201 269 return rotate; 202 } 203 204 Vector3d& Vector3d::operator+=(const Vector3d& v) 270 } 271 //++ 272 void 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 //++ 284 Vector3d& Vector3d::operator += (const Vector3d& v) 285 // 286 //-- 205 287 { 206 288 *this=*this+v; 207 289 return *this; 208 290 } 209 210 Vector3d& Vector3d::operator-=(const Vector3d& v) 291 //++ 292 Vector3d& Vector3d::operator -= (const Vector3d& v) 293 // 294 //-- 211 295 { 212 296 *this=*this-v; 213 297 return *this; 214 298 } 215 216 Vector3d& Vector3d::operator+=(double d) 299 //++ 300 Vector3d& Vector3d::operator += (double d) 301 // 302 //-- 217 303 { 218 304 Setxyz(_x+d,_y+d,_z+d); 219 305 return *this; 220 306 } 221 222 Vector3d& Vector3d::operator/=(double d) 307 //++ 308 Vector3d& Vector3d::operator /= (double d) 309 // 310 //-- 223 311 { 224 312 if( d != 0. ) Setxyz(_x/d,_y/d,_z/d); … … 226 314 return *this; 227 315 } 228 229 Vector3d& Vector3d::operator*=(double d) 316 //++ 317 Vector3d& Vector3d::operator *= (double d) 318 // 319 //-- 230 320 { 231 321 Setxyz(_x*d,_y*d,_z*d); 232 322 return *this; 233 323 } 234 235 Vector3d Vector3d::operator^(const Vector3d& v) const 324 //++ 325 Vector3d Vector3d::operator ^ (const Vector3d& v) const 326 // 327 // vector product 328 //-- 236 329 { 237 330 return this->Vect(v); 238 331 } 239 240 Vector3d Vector3d::operator+(double d) const 332 //++ 333 Vector3d Vector3d::operator + (double d) const 334 // 335 //-- 241 336 { 242 337 return Vector3d(_x+d,_y+d,_z+d); 243 338 } 244 245 Vector3d Vector3d::operator+(const Vector3d& v) const 339 //++ 340 Vector3d Vector3d::operator + (const Vector3d& v) const 341 // 342 //-- 246 343 { 247 344 return Vector3d(_x+v._x,_y+v._y,_z+v._z); 248 345 } 249 250 Vector3d Vector3d::operator-(double d) const 346 //++ 347 Vector3d Vector3d::operator - (double d) const 348 // 349 //-- 251 350 { 252 351 return *this+(-d); 253 352 } 254 255 Vector3d Vector3d::operator-(const Vector3d& v) const 353 //++ 354 Vector3d Vector3d::operator - (const Vector3d& v) const 355 // 356 //-- 256 357 { 257 358 return *this+(v*(-1.)); 258 359 } 259 260 Vector3d Vector3d::operator*(double d) const 360 //++ 361 Vector3d Vector3d::operator * (double d) const 362 // 363 //-- 261 364 { 262 365 return Vector3d(d*_x,d*_y,d*_z); 263 366 } 264 265 double Vector3d::operator*(const Vector3d& v) const 367 //++ 368 double Vector3d::operator * (const Vector3d& v) const 369 // 370 // dot product 371 //-- 266 372 { 267 373 return this->Psc(v); 268 374 } 269 270 Vector3d Vector3d::operator/(double d) const 375 //++ 376 Vector3d Vector3d::operator / (double d) const 377 // 378 //-- 271 379 { 272 380 Vector3d ret=*this; … … 275 383 return ret; 276 384 } 277 278 Vector3d& Vector3d::operator=(const Vector3d& v) 385 //++ 386 Vector3d& Vector3d::operator = (const Vector3d& v) 387 // 388 //-- 279 389 { 280 390 if( this != &v ) … … 288 398 return *this; 289 399 } 400 //++ 401 bool Vector3d::operator == (const Vector3d& v) 402 // 403 //-- 404 { 405 return (this==&v); 406 } 290 407 291 bool Vector3d::operator==(const Vector3d& v)292 {293 return (this==&v);294 }295 296 void Vector3d::Print(ostream& os) const297 {298 os << "Vector3: (X,Y,Z)= (" << _x << ", " << _y << ", " << _z299 << ") --- Theta,Phi= " << _theta << ", " << _phi << "\n"300 << "Norme = " << this->Norm() << endl;301 } -
trunk/SophyaLib/Samba/vector3d.h
r518 r565 18 18 pour les rotations (angles d'Euler) ma source est 19 19 "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 20 29 */ 21 30 … … 51 60 52 61 // ecart angulaire entre 2 vecteurs dans [0,Pi] 62 /*! angular gap between 2 vectors in [0,Pi] */ 53 63 virtual double SepAngle(const Vector3d&) const; 54 64 55 65 // produit vectoriel 66 /*! vector product */ 56 67 virtual Vector3d Vect(const Vector3d&) const; 57 68 58 69 // vecteur perpendiculaire de meme phi 70 /*! perpendicular vector, with equal phi */ 59 71 virtual Vector3d VperpPhi() const; 60 72 61 73 // vecteur perpendiculaire de meme theta 74 /*! perpendicular vector with equal theta */ 62 75 virtual Vector3d VperpTheta() const; 63 76 … … 65 78 virtual Vector3d EPhi() const; 66 79 80 // rotations d'Euler 81 /*! Euler's rotations */ 67 82 // rotations d Euler 68 83 virtual Vector3d Euler(double, double, double) const; 69 84 70 85 // rotation inverse 86 /*! inverse rotation */ 71 87 Vector3d InvEuler(double, double, double) const; 72 88 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) */ 74 91 Vector3d Rotate(const Vector3d& omega,double phi); 75 92 … … 89 106 virtual Vector3d operator/(double) const; 90 107 108 /*! vector product */ 91 109 virtual Vector3d operator^(const Vector3d&) const; // produit vectoriel 110 /*! dot product */ 92 111 virtual double operator*(const Vector3d&) const; // produit scalaire 93 112
Note:
See TracChangeset
for help on using the changeset viewer.