PageRenderTime 24ms CodeModel.GetById 13ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/Proj4/pj_auth.c

http://github.com/route-me/route-me
C | 34 lines | 32 code | 1 blank | 1 comment | 1 complexity | 7aa5fcdf573190d6e88be0f01dbce4ec MD5 | raw file
 1/* determine latitude from authalic latitude */
 2#ifndef lint
 3static const char SCCSID[]="@(#)pj_auth.c	4.3	93/06/12	GIE	REL";
 4#endif
 5#include "projects.h"
 6# define P00 .33333333333333333333
 7# define P01 .17222222222222222222
 8# define P02 .10257936507936507936
 9# define P10 .06388888888888888888
10# define P11 .06640211640211640211
11# define P20 .01641501294219154443
12#define APA_SIZE 3
13	double *
14pj_authset(double es) {
15	double t, *APA;
16
17	APA = (double *)pj_malloc(APA_SIZE * sizeof(double));
18	if (APA) {
19		APA[0] = es * P00;
20		t = es * es;
21		APA[0] += t * P01;
22		APA[1] = t * P10;
23		t *= es;
24		APA[0] += t * P02;
25		APA[1] += t * P11;
26		APA[2] = t * P20;
27	}
28	return APA;
29}
30	double
31pj_authlat(double beta, double *APA) {
32	double t = beta+beta;
33	return(beta + APA[0] * sin(t) + APA[1] * sin(t+t) + APA[2] * sin(t+t+t));
34}