www.pudn.com > test_gauss_proj.rar > test_gauss_proj.cpp


// test_gauss_proj.cpp : 定义控制台应用程序的入口点。 
// 
 
#include "stdafx.h" 
#include "GaussProj.h" 
 
int _tmain(int argc, _TCHAR* argv[]) 
{ 
	CProjection m_GaussProj; 
	double L0, Val1, Val2; 
	bool   fgDirect; 
 
	if(argc < 5) 
    { 
        printf("test L0 val1 val2 direct \n"); 
        printf("direct: 0 -- convert B,l to x,y\n"); 
        printf("        1 -- convert x,y to B,l\n"); 
        return 0; 
    } 
 
	L0  = atof(argv[1]); 
	Val1 = atof(argv[2]); 
	Val2 = atof(argv[3]); 
 
	fgDirect = (bool)atoi(argv[4]); 
 
	m_GaussProj.fgSetCurL0(L0); 
 
	if(fgDirect) 
	{ 
		printf("convert x,y to B,l now:\n"); 
 
		m_GaussProj.fgConvertxy2Bl(Val1, Val2); 
		m_GaussProj.fgGetConvertedBl(&Val1, &Val2); 
 
		printf("in L0: %f, converted B,l are: %f, %f \n", L0, Val1, Val2); 
	} 
	else 
	{ 
		printf("convert B,l to x,y now:\n"); 
 
		m_GaussProj.fgConvertBl2xy(Val1, Val2); 
		m_GaussProj.fgGetConvertedxy(&Val1, &Val2); 
 
		printf("in L0: %f, converted x,y are: %f, %f \n", L0, Val1, Val2); 
	} 
 
	return 0; 
}