| 
            Last change
 on this file since 2782 was             2322, checked in by cmv, 23 years ago           | 
        
        
          
            - passage xxstream.h en xxstream
 - compile avec gcc_3.2, gcc_2.96 et cxx
En 3.2 le seek from ::end semble marcher (voir Eval/COS/pbseekios.cc)
 
 
rz+cmv 11/2/2003 
 
 
 
           | 
        
        
          | 
            File size:
            1.0 KB
           | 
        
      
      
| Line |   | 
|---|
| 1 | //   Geometry handling class 
 | 
|---|
| 2 | //       B. Revenu, R. Ansari , G. Le Meur   2000
 | 
|---|
| 3 | // DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
 | 
|---|
| 4 | 
 | 
|---|
| 5 | #ifndef LONGLAT_H_SEEN
 | 
|---|
| 6 | #define LONGLAT_H_SEEN
 | 
|---|
| 7 | 
 | 
|---|
| 8 | #include "machdefs.h"
 | 
|---|
| 9 | #include <math.h>
 | 
|---|
| 10 | #include <iostream>
 | 
|---|
| 11 | #include <stdio.h>
 | 
|---|
| 12 | #include <string.h>
 | 
|---|
| 13 | #include "utilgeom.h"
 | 
|---|
| 14 | 
 | 
|---|
| 15 | /*
 | 
|---|
| 16 |   passage des coordonnees longitude, latitude en theta,phi
 | 
|---|
| 17 |   longitude=phi
 | 
|---|
| 18 |   latitude=Pi/2-theta
 | 
|---|
| 19 | */
 | 
|---|
| 20 | 
 | 
|---|
| 21 | namespace SOPHYA {  
 | 
|---|
| 22 | 
 | 
|---|
| 23 | class LongLat
 | 
|---|
| 24 | {
 | 
|---|
| 25 |   
 | 
|---|
| 26 |  public:
 | 
|---|
| 27 |   
 | 
|---|
| 28 |   LongLat();
 | 
|---|
| 29 |   LongLat(double longitude, double latitude);
 | 
|---|
| 30 |   LongLat(double x, double y, double z);
 | 
|---|
| 31 |   LongLat(const LongLat&);
 | 
|---|
| 32 |   
 | 
|---|
| 33 |   void Set(double longitude, double latitude);
 | 
|---|
| 34 |   double Longitude() const {return _lon;}
 | 
|---|
| 35 |   double Phi() const {return _lon;}
 | 
|---|
| 36 |   double Latitude() const {return _lat;}
 | 
|---|
| 37 |   double Theta() const {return pi_over_2-_lat;}
 | 
|---|
| 38 | 
 | 
|---|
| 39 |   void Print(ostream& os) const;
 | 
|---|
| 40 |   
 | 
|---|
| 41 |  private:
 | 
|---|
| 42 |   
 | 
|---|
| 43 |   double _lon; // lambda
 | 
|---|
| 44 |   double _lat; // beta
 | 
|---|
| 45 |   
 | 
|---|
| 46 | };
 | 
|---|
| 47 | 
 | 
|---|
| 48 | inline ostream& operator<<(ostream& s, const LongLat& ll) 
 | 
|---|
| 49 | {  
 | 
|---|
| 50 |   ll.Print(s);  
 | 
|---|
| 51 |   return s;  
 | 
|---|
| 52 | }
 | 
|---|
| 53 | 
 | 
|---|
| 54 | } // namespace SOPHYA
 | 
|---|
| 55 | 
 | 
|---|
| 56 | #endif
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.