ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/landscape.cal
Revision: 1.2
Committed: Wed Nov 21 18:10:45 2018 UTC (5 years, 5 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R3, HEAD
Changes since 1.1: +1 -0 lines
Log Message:
Added missing RCSid tag

File Contents

# Content
1 { RCSid $Id$ }
2 {
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);