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-vt/sys/src/cmd/map/libmap/gall.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
static double scale;
6
 
7
static int
8
Xgall(struct place *place, double *x, double *y)
9
{
10
	/* two ways to compute tan(place->nlat.l/2) */
11
	if(fabs(place->nlat.s)<.1)
12
		*y = sin(place->nlat.l/2)/cos(place->nlat.l/2);
13
	else
14
		*y = (1-place->nlat.c)/place->nlat.s;
15
	*x = -scale*place->wlon.l;
16
	return 1;
17
}
18
 
19
proj
20
gall(double par)
21
{
22
	double coshalf;
23
	if(fabs(par)>80)
24
		return 0;
25
	par *= RAD;
26
	coshalf = cos(par/2);
27
	scale = cos(par)/(2*coshalf*coshalf);
28
	return Xgall;
29
}