ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/plocate.c
Revision: 2.1
Committed: Tue Nov 12 17:00:45 1991 UTC (32 years, 5 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 1.2: +0 -0 lines
Log Message:
updated revision number for release 2.0

File Contents

# Content
1 /* Copyright (c) 1986 Regents of the University of California */
2
3 #ifndef lint
4 static char SCCSid[] = "$SunId$ LBL";
5 #endif
6
7 /*
8 * plocate.c - routine to locate 3D vector w.r.t. box.
9 *
10 * 8/28/85
11 */
12
13 #include "fvect.h"
14
15 #include "plocate.h"
16
17
18 int
19 plocate(p, min, max) /* return location of p w.r.t. min & max */
20 register FVECT p;
21 FVECT min, max;
22 {
23 register int loc = 0;
24
25 if (p[0] < min[0] - EPSILON)
26 loc |= XPOS & BELOW;
27 else if (p[0] > max[0] + EPSILON)
28 loc |= XPOS & ABOVE;
29 if (p[1] < min[1] - EPSILON)
30 loc |= YPOS & BELOW;
31 else if (p[1] > max[1] + EPSILON)
32 loc |= YPOS & ABOVE;
33 if (p[2] < min[2] - EPSILON)
34 loc |= ZPOS & BELOW;
35 else if (p[2] > max[2] + EPSILON)
36 loc |= ZPOS & ABOVE;
37
38 return(loc);
39 }