|
|
1.1 root 1: #include "map.h"
2:
3: float viewpt;
4:
5: Xperspective(p, x, y)
6: struct place *p;
7: float *x, *y;
8: {
9: float r;
10: if(viewpt<=1. && p->nlat.s<=viewpt+.01)
11: return(-1);
12: r = p->nlat.c*(viewpt - 1.)/(viewpt - p->nlat.s);
13: *x = - r*p->wlon.s;
14: *y = - r*p->wlon.c;
15: if(r>4.)
16: return(0);
17: if(fabs(viewpt)>1. && p->nlat.s<=1./viewpt)
18: return(0);
19: return(1);
20: }
21:
22: Xstereographic(p, x, y)
23: struct place *p;
24: float *x, *y;
25: {
26: viewpt = -1;
27: return(Xperspective(p, x, y));
28: }
29:
30: int (*perspective(radius))()
31: float radius;
32: {
33: extern Xorthographic();
34: viewpt = radius;
35: if(radius>=1000.)
36: return(Xorthographic);
37: if(fabs(radius-1.)<.0001)
38: exit(1);
39: return(Xperspective);
40: }
41:
42: int (*stereographic())()
43: {
44: viewpt = -1.;
45: return(Xperspective);
46: }
47:
48: int (*gnomonic())()
49: {
50: viewpt = 0.;
51: return(Xperspective);
52: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.