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_unix/sys/src/cmd/map/libmap/mollweide.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 int
6
Xmollweide(struct place *place, double *x, double *y)
7
{
8
	double z;
9
	double w;
10
	z = place->nlat.l;
11
	if(fabs(z)<89.9*RAD)
12
		do {	/*newton for 2z+sin2z=pi*sin(lat)*/
13
			w = (2*z+sin(2*z)-PI*place->nlat.s)/(2+2*cos(2*z));
14
			z -= w;
15
		} while(fabs(w)>=.00001);
16
	*y = sin(z);
17
	*x = - (2/PI)*cos(z)*place->wlon.l;
18
	return(1);
19
}
20
 
21
proj
22
mollweide(void)
23
{
24
	return(Xmollweide);
25
}