⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pj_vandg2.cpp

📁 projapi是一个关于GIS行业投影转换的程序库
💻 CPP
字号:

#include "stdafx.h"

#ifndef lintstatic const char SCCSID[]="@(#)PJ_vandg2.c	4.1	94/02/15	GIE	REL";#endif# define TOL	1e-10# define TWORPI	0.63661977236758134308#define PROJ_PARMS__ \	int	vdg3;#define PJ_LIB__#include	"projects.h"
#include <math.h>
PROJ_HEAD(vandg2, "van der Grinten II") "\n\tMisc Sph, no inv.";PROJ_HEAD(vandg3, "van der Grinten III") "\n\tMisc Sph, no inv.";FORWARD(s_forward); /* spheroid */	double x1, at, bt, ct;	bt = fabs(TWORPI * lp.phi);	if ((ct = 1. - bt * bt) < 0.)		ct = 0.;	else		ct = sqrt(ct);	if (fabs(lp.lam) < TOL) {		xy.x = 0.;		xy.y = PI * (lp.phi < 0. ? -bt : bt) / (1. + ct);	} else {		at = 0.5 * fabs(PI / lp.lam - lp.lam / PI);		if (P->vdg3) {			x1 = bt / (1. + ct);			xy.x = PI * (sqrt(at * at + 1. - x1 * x1) - at);			xy.y = PI * x1;		} else {			x1 = (ct * sqrt(1. + at * at) - at * ct * ct) /				(1. + at * at * bt * bt);			xy.x = PI * x1;			xy.y = PI * sqrt(1. - x1 * (x1 + 2. * at) + TOL);		}		if ( lp.lam < 0.) xy.x = -xy.x;		if ( lp.phi < 0.) xy.y = -xy.y;	}	return (xy);}FREEUP; if (P) pj_dalloc(P); }ENTRY0(vandg2)	P->vdg3 = 0;	P->inv = 0; P->fwd = s_forward;ENDENTRY(P)ENTRY0(vandg3)	P->vdg3 = 1;	P->es = 0.; P->fwd = s_forward;ENDENTRY(P)

⌨️ 快捷键说明

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