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

Comparing ray/src/rt/srcsupp.c (file contents):
Revision 1.5 by greg, Mon Jun 24 16:00:30 1991 UTC vs.
Revision 1.6 by greg, Tue Jun 25 13:11:55 1991 UTC

# Line 296 | Line 296 | FVECT  nrm;            /* source surface normal */
296  
297  
298   double
299 + spotdisk(oc, op, sp, pos)       /* intersect spot with object op */
300 + FVECT  oc;
301 + OBJREC  *op;
302 + register SPOT  *sp;
303 + FVECT  pos;
304 + {
305 +        FVECT  onorm;
306 +        double  offs, d, dist;
307 +        register int  i;
308 +
309 +        offs = getplaneq(onorm, op);
310 +        d = -DOT(onorm, sp->aim);
311 +        if (d >= -FTINY && d <= FTINY)
312 +                return(0.);
313 +        dist = (DOT(pos, onorm) - offs)/d;
314 +        if (dist < 0.)
315 +                return(0.);
316 +        for (i = 0; i < 3; i++)
317 +                oc[i] = pos[i] + dist*sp->aim[i];
318 +        return(sp->siz*dist*dist/PI/(d*d));
319 + }
320 +
321 +
322 + double
323 + beamdisk(oc, op, sp, dir)       /* intersect beam with object op */
324 + FVECT  oc;
325 + OBJREC  *op;
326 + register SPOT  *sp;
327 + FVECT  dir;
328 + {
329 +        FVECT  onorm;
330 +        double  offs, d, dist;
331 +        register int  i;
332 +
333 +        offs = getplaneq(onorm, op);
334 +        d = -DOT(onorm, dir);
335 +        if (d >= -FTINY && d <= FTINY)
336 +                return(0.);
337 +        dist = (DOT(sp->aim, onorm) - offs)/d;
338 +        for (i = 0; i < 3; i++)
339 +                oc[i] = sp->aim[i] + dist*dir[i];
340 +        return(sp->siz/PI/(d*d));
341 + }
342 +
343 +
344 + double
345   intercircle(cc, c1, c2, r1s, r2s)       /* intersect two circles */
346   FVECT  cc;                      /* midpoint (return value) */
347   FVECT  c1, c2;                  /* circle centers */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines