ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/genrev.c
(Generate patch)

Comparing ray/src/gen/genrev.c (file contents):
Revision 1.3 by greg, Wed Oct 18 17:43:46 1989 UTC vs.
Revision 1.5 by greg, Wed Mar 7 11:14:40 1990 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1989 Regents of the University of California */
2
1   #ifndef lint
2   static char SCCSid[] = "$SunId$ LBL";
3   #endif
4  
5 + /* Copyright (c) 1989 Regents of the University of California */
6 +
7   /*
8   *  genrev.c - program to generate functions of rotation about z
9   *
# Line 28 | Line 28 | static char SCCSid[] = "$SunId$ LBL";
28   #define  UP             04
29   #define  DOWN           010
30  
31 < double  funvalue(), l_hermite(), argument();
31 > double  funvalue(), l_hermite(), l_bezier(), l_bspline(), argument();
32  
33  
34   main(argc, argv)
# Line 45 | Line 45 | char  *argv[];
45  
46          varset("PI", PI);
47          funset("hermite", 5, l_hermite);
48 +        funset("bezier", 5, l_bezier);
49 +        funset("bspline", 5, l_bspline);
50  
51          if (argc < 6)
52                  goto userror;
# Line 210 | Line 212 | l_hermite()                    
212                  argument(2)*(-2.0*t+3.0)*t*t +
213                  argument(3)*((t-2.0)*t+1.0)*t +
214                  argument(4)*(t-1.0)*t*t );
215 + }
216 +
217 +
218 + double
219 + l_bezier()
220 + {
221 +        double  t;
222 +
223 +        t = argument(5);
224 +        return( argument(1) * (1.+t*(-3.+t*(3.-t))) +
225 +                argument(2) * 3.*t*(1.+t*(-2.+t)) +
226 +                argument(3) * 3.*t*t*(1.-t) +
227 +                argument(4) * t*t*t );
228 + }
229 +
230 +
231 + double
232 + l_bspline()
233 + {
234 +        double  t;
235 +
236 +        t = argument(5);
237 +        return( argument(1) * (1./6.+t*(-1./2.+t*(1./2.-1./6.*t))) +
238 +                argument(2) * (2./3.+t*t*(-1.+1./2.*t)) +
239 +                argument(3) * (1./6.+t*(1./2.+t*(1./2.-1./2.*t))) +
240 +                argument(4) * (1./6.*t*t*t) );
241   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines