Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/cmd/map/libmap/polyconic.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
#include "map.h"
4
 
5
int
6
Xpolyconic(struct place *place, double *x, double *y)
7
{
8
	double r, alpha;
9
	double lat2, lon2;
10
	if(fabs(place->nlat.l) > .01) {
11
		r = place->nlat.c / place->nlat.s;
12
		alpha = place->wlon.l * place->nlat.s;
13
		*y = place->nlat.l + r*(1 - cos(alpha));
14
		*x = - r*sin(alpha);
15
	} else {
16
		lon2 = place->wlon.l * place->wlon.l;
17
		lat2 = place->nlat.l * place->nlat.l;
18
		*y = place->nlat.l * (1+(lon2/2)*(1-(8+lon2)*lat2/12));
19
		*x = - place->wlon.l * (1-lat2*(3+lon2)/6);
20
	}
21
	return(1);
22
}
23
 
24
proj
25
polyconic(void)
26
{
27
	return(Xpolyconic);
28
}