1 |
greg |
1.2 |
{ RCSid $Id$ } |
2 |
greg |
1.1 |
{ |
3 |
|
|
A set of randomly located points at known positions to be |
4 |
|
|
interpolated by gensurf. |
5 |
|
|
} |
6 |
|
|
{ The following are our known point values } |
7 |
|
|
point(i,j) = select( i*3+j+1, |
8 |
|
|
2, 1, 5, { x0, y0, z0 } |
9 |
|
|
3.7, 1, 1, |
10 |
|
|
4.2, 2.5, 2, |
11 |
|
|
3,7, 2.5, 4, |
12 |
|
|
2, 2.5, 3, |
13 |
|
|
2, 3.5, 2 |
14 |
|
|
); |
15 |
|
|
|
16 |
|
|
Npoints = 6; { Number of points in above } |
17 |
|
|
|
18 |
|
|
sq(x) : x*x; |
19 |
|
|
|
20 |
|
|
Recip(x) : if( x, 1/x, 1e10 ); |
21 |
|
|
|
22 |
|
|
Sum(f,x,y,n) = if(n-.5, f(x,y,n-1)+Sum(f,x,y,n-1), 0); |
23 |
|
|
|
24 |
|
|
weight(x,y,i) = Recip(sq(x-point(i,0)) + sq(y-point(i,1))); |
25 |
|
|
|
26 |
|
|
wval(x,y,i) = weight(x,y,i) * point(i,2); |
27 |
|
|
|
28 |
|
|
sheight(x,y) = Sum(wval,x,y,Npoints) / Sum(weight,x,y,Npoints); |