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/lagrange.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
Xlagrange(struct place *place, double *x, double *y)
7
{
8
	double z1,z2;
9
	double w1,w2,t1,t2;
10
	struct place p;
11
	copyplace(place,&p);
12
	if(place->nlat.l<0) {
13
		p.nlat.l = -p.nlat.l;
14
		p.nlat.s = -p.nlat.s;
15
	}
16
	Xstereographic(&p,&z1,&z2);
17
	csqrt(-z2/2,z1/2,&w1,&w2);
18
	cdiv(w1-1,w2,w1+1,w2,&t1,&t2);
19
	*y = -t1;
20
	*x = t2;
21
	if(place->nlat.l<0)
22
		*y = -*y;
23
	return(1);
24
}
25
 
26
proj
27
lagrange(void)
28
{
29
	return(Xlagrange);
30
}