test_gauss_proj.cpp

来自「这是一个高斯投影变换的类」· C++ 代码 · 共 51 行

CPP
51
字号
// 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;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?