资源简介
使用VC6.0的MFC编写的大地程序【高斯投影坐标正反算】。大家可以下载借鉴,不要抄袭。版权归武汉大学测绘学院黄亮所有(上传时间20120701)。
代码片段和文件信息
#include “StdAfx.h“
#include
#include “GaussProjection.h“
#define Pi 3.141592653589793
GaussProjection::GaussProjection()
{
}
GaussProjection::~GaussProjection()
{
}
/*************************************************
* Function: AngleToRadian()
* Description:
* parameter: Angle(DD.MMSSS)
* Return: Radian
**************************************************/
double GaussProjection::AngleToRadian(double dfm1)
{
//角度化弧度参数
double p_d = Pi / 180;
double p_f = p_d / 60;
double p_m = p_f / 60;
//弥补存储缺陷
double dfm = dfm1;
double du = floor(dfm);
double temp = dfm - du;
double fe = floor(temp * 100);
double mi = (temp * 100 - fe) * 100;
double radian = du * p_d + fe * p_f + mi * p_m;
return radian;
}
/*************************************************
* Function: RadianToAngle()
* Description:
* parameter: Radian
* Return: Angle(DD.MMSSS)
**************************************************/
double GaussProjection::RadianToAngle(double radian)
{
double flag;
if (radian > 0) { flag = 1;}
else
{
flag = -1;
radian = fabs(radian);
}
double angle_tmp = radian * 180 / Pi;
double Du = floor(angle_tmp);
double Fe = floor((angle_tmp - Du) * 60);
double Mi = ((angle_tmp - Du) * 60 - Fe) * 60;
if (fabs(Mi-60)<0.0001) //秒60进1 分60进1
{
Mi = 0;
Fe = Fe + 1;
if (fabs(Fe - 60) < 0.0001)
{
Fe = 0;
Du = Du + 1;
}
}
double angle = (Du + Fe / 100 + Mi / 10000) * flag;
return angle;
}
void GaussProjection::Nekrasov_ForWard(double Bdouble Ldouble Lodouble &xdouble &y)
{
//辅助量
double cosB = cos(B);
double sinB = sin(B);
double cosB_2 = cosB * cosB;
double l = L - Lo * Pi / 180;
double ll = l * l;
//计算系数
double N = 6399698.902 - (21562.267 - (108.973 - 0.612 * cosB_2) * cosB_2) * cosB_2;
double a0 = 32140.404 - (135.3302 - (0.7092 - 0.0040 * cosB_2) * cosB_2) * cosB_2;
double a4 = (0.25 + 0.00252 * cosB_2) * cosB_2 - 0.04166;
double a6 = (0.166 * cosB_2 - 0.084) * cosB_2;
double a3 = (0.3333333 + 0.001123 * cosB_2) * cosB_2 - 0.1666667;
double a5 = 0.0083 - (0.1667 - (0.1968 + 0.0040 * cosB_2) * cosB_2) * cosB_2;
//计算高斯平面坐标值
x = 6367558.4969 * B - (a0 - (0.5 + (a4 + a6 * ll) * ll) * ll * N) * cosB * sinB;
y = (1 + (a3 + a5 * ll) * ll) * l * N * cosB + 500000;
}
void GaussProjection::Inte1975_Forward(double Bdouble Ldouble Lodouble &xdouble &y)
{
//辅助量
double cosB = cos(B);
double sinB = sin(B);
double cosB_2 = cosB * cosB;
double l = L - Lo * Pi / 180;
double ll = l * l;
//计算系数
double N = 6399596.596 - (21565.045 - (108.996 - 0.603 * cosB_2) * cosB_2) * cosB_2;
double a0 = 32144.5189 - (135.3646 - (0.7034 - 0.0041 * cosB_2) * cosB_2) * cosB_2;
double a4 = (0.25 + 0.00253 * cosB_2) * cosB_2 - 0.04167;
double a6 = (0.167 * cosB_2 - 0.083) * cosB_2;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-05-06 22:07 Projection\
目录 0 2012-04-19 22:10 Projection\Debug\
文件 21689 2012-04-19 20:19 Projection\Debug\GaussProjection.obj
文件 20031 2012-04-19 20:12 Projection\Debug\MainFrm.obj
文件 122965 2012-04-20 20:55 Projection\Debug\Projection.exe
文件 347340 2012-04-20 20:55 Projection\Debug\Projection.ilk
文件 23273 2012-04-19 22:10 Projection\Debug\Projection.obj
文件 5499652 2012-04-19 20:12 Projection\Debug\Projection.pch
文件 484352 2012-04-19 22:10 Projection\Debug\Projection.pdb
文件 8036 2012-04-19 20:12 Projection\Debug\Projection.res
文件 15030 2012-04-19 20:12 Projection\Debug\ProjectionDoc.obj
文件 28692 2012-04-20 20:55 Projection\Debug\ProjectionView.obj
文件 105734 2012-04-19 20:12 Projection\Debug\StdAfx.obj
文件 214016 2012-04-20 20:55 Projection\Debug\vc60.idb
文件 364544 2012-04-19 22:10 Projection\Debug\vc60.pdb
文件 5279 2012-05-06 22:07 Projection\GaussProjection.cpp
文件 534 2012-04-19 20:19 Projection\GaussProjection.h
文件 2511 2012-04-19 19:18 Projection\MainFrm.cpp
文件 1581 2012-04-19 19:18 Projection\MainFrm.h
文件 45400 2012-04-19 19:49 Projection\Projection.aps
文件 3127 2012-05-06 22:07 Projection\Projection.clw
文件 4281 2012-04-19 19:18 Projection\Projection.cpp
文件 4781 2012-04-19 22:13 Projection\Projection.dsp
文件 545 2012-04-19 19:18 Projection\Projection.dsw
文件 1400 2012-04-19 19:18 Projection\Projection.h
文件 66560 2012-05-06 22:07 Projection\Projection.ncb
文件 48640 2012-05-06 22:07 Projection\Projection.opt
文件 794 2012-04-20 20:55 Projection\Projection.plg
文件 13205 2012-04-19 19:49 Projection\Projection.rc
文件 1822 2012-04-19 19:18 Projection\ProjectionDoc.cpp
文件 1519 2012-04-19 19:18 Projection\ProjectionDoc.h
............此处省略11个文件信息
- 上一篇:异形窗口加局部透明
- 下一篇:c++生成word和pdf
评论
共有 条评论