www.pudn.com > test_gauss_proj.rar > GaussProj.h


//GaussProj.h 
#ifndef _GAUSS_PROJ_H_ 
#define _GAUSS_PROJ_H_ 
 
#define PI 3.1415926535897932384626433832795 
#define EE 2.7182818284590452353602874713527 
 
//definations for Ellipsoid type 
typedef enum 
{ 
    ELLIPSOID_TYPE_KRASSOVSKY, 
    ELLIPSOID_TYPE_IAG75, 
    ELLIPSOID_TYPE_WGS84, 
    ELLIPSOID_TYPE_DEFAULT = ELLIPSOID_TYPE_KRASSOVSKY     
} ELLIPSOID_TYPE_T; 
 
typedef struct sEllipCoeff 
{ 
    double a; 
    double A1; 
    double A2; 
    double A3; 
    double A4; 
    double A5; 
     
    //double f; 
    double e2; 
    double e12; 
     
} ELLIP_COEFF_T; 
 
//the main class 
class CProjection 
{ 
    private : 
        //the coeffitients of certain ellipsoid 
        ELLIP_COEFF_T eEllipCoeff; 
        //function to set coeffitions accordding to ellipsoid type 
        void vSetEllipCoeff(ELLIPSOID_TYPE_T eEllipType); 
 
    private : 
 
        double CurL0; 
 
        ELLIPSOID_TYPE_T eEllipsoidType; 
         
         
    private : 
     
        double B; 
        double l; 
         
        double x; 
        double y; 
 
    public : 
 
        void vSetEllipsoidType(ELLIPSOID_TYPE_T eType); 
 
        //the parameters B&l shoul be in dec. DD.MMSS format! 
        //for example: 10.302530 means 10 degrees,30 minutes, 25.30 seconds 
        bool fgConvertBl2xy(double ConvB, double Convl); 
        //the parameters x&y should be in meter unit! 
        bool fgConvertxy2Bl(double Convx, double Convy); 
         
        bool fgGetConvertedxy(double *pConvx, double *pConvy); 
        bool fgGetConvertedBl(double *pConvB, double *pConvl); 
 
        bool fgSetCurL0(double L0); 
 
    public : 
 
        CProjection(); 
        ~CProjection(); 
 
}; 
 
//common functions 
double ConvertDms2Rad(double Dms); 
double ConvertRad2Dms(double Rad); 
 
#endif //_GAUSS_PROJ_H_