Cartography-Projection-GCTP
view release on metacpan or search on metacpan
gctpc/goodfor.c view on Meta::CPAN
/*******************************************************************************
NAME GOODE'S HOMOLOSINE
PURPOSE: Transforms input longitude and latitude to Easting and
Northing for the Goode's Homolosine projection. The
longitude and latitude must be in radians. The Easting
and Northing values will be returned in meters.
PROGRAMMER DATE
---------- ----
D. Steinwand, EROS May, 1991; Updated Sept, 1992; Updated Feb 1993
S. Nelson, EDC Jun, 1993 Make changes in precision and number
of iterations.
ALGORITHM REFERENCES
1. Snyder, John P. and Voxland, Philip M., "An Album of Map Projections",
U.S. Geological Survey Professional Paper 1453 , United State Government
Printing Office, Washington D.C., 1989.
2. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
State Government Printing Office, Washington D.C., 1987.
3. Goode, J.P., 1925, The Homolosine projection: a new device for
portraying the Earth's surface entire: Assoc. Am. Geographers, Annals,
v. 15, p. 119-125
*******************************************************************************/
#include "cproj.h"
/* Variables common to all subroutines in this code file
-----------------------------------------------------*/
static double R; /* Radius of the earth (sphere) */
static double lon_center[12]; /* Central meridians, one for each region */
static double feast[12]; /* False easting, one for each region */
/* Initialize the Goode`s Homolosine projection
--------------------------------------------*/
long goodforint(r)
double r; /* (I) Radius of the earth (sphere) */
{
/* Place parameters in static storage for common use
-------------------------------------------------*/
R = r;
/* Initialize central meridians for each of the 12 regions
-------------------------------------------------------*/
lon_center[0] = -1.74532925199; /* -100.0 degrees */
lon_center[1] = -1.74532925199; /* -100.0 degrees */
lon_center[2] = 0.523598775598; /* 30.0 degrees */
lon_center[3] = 0.523598775598; /* 30.0 degrees */
lon_center[4] = -2.79252680319; /* -160.0 degrees */
lon_center[5] = -1.0471975512; /* -60.0 degrees */
lon_center[6] = -2.79252680319; /* -160.0 degrees */
lon_center[7] = -1.0471975512; /* -60.0 degrees */
lon_center[8] = 0.349065850399; /* 20.0 degrees */
lon_center[9] = 2.44346095279; /* 140.0 degrees */
lon_center[10] = 0.349065850399; /* 20.0 degrees */
lon_center[11] = 2.44346095279; /* 140.0 degrees */
/* Initialize false eastings for each of the 12 regions
----------------------------------------------------*/
feast[0] = R * -1.74532925199;
feast[1] = R * -1.74532925199;
feast[2] = R * 0.523598775598;
feast[3] = R * 0.523598775598;
feast[4] = R * -2.79252680319;
feast[5] = R * -1.0471975512;
feast[6] = R * -2.79252680319;
feast[7] = R * -1.0471975512;
feast[8] = R * 0.349065850399;
feast[9] = R * 2.44346095279;
feast[10] = R * 0.349065850399;
( run in 0.876 second using v1.01-cache-2.11-cpan-71847e10f99 )