| Revision: | 2.3 |
| Committed: | Tue Feb 25 02:47:21 2003 UTC (22 years, 8 months ago) by greg |
| Content type: | text/plain |
| Branch: | MAIN |
| CVS Tags: | rad5R4, rad5R2, rad5R3, rad5R0, rad5R1, rad4R2, rad3R7P2, rad3R7P1, rad6R0, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad4R2P2, HEAD |
| Changes since 2.2: | +1 -56 lines |
| Log Message: | Replaced inline copyright notice with #include "copyright.h" |
| # | Content |
|---|---|
| 1 | #ifndef lint |
| 2 | static const char RCSid[] = "$Id$"; |
| 3 | #endif |
| 4 | /* |
| 5 | * plocate.c - routine to locate 3D vector w.r.t. box. |
| 6 | */ |
| 7 | |
| 8 | #include "copyright.h" |
| 9 | |
| 10 | #include "fvect.h" |
| 11 | |
| 12 | #include "plocate.h" |
| 13 | |
| 14 | |
| 15 | int |
| 16 | plocate(p, min, max) /* return location of p w.r.t. min & max */ |
| 17 | register FVECT p; |
| 18 | FVECT min, max; |
| 19 | { |
| 20 | register int loc = 0; |
| 21 | |
| 22 | if (p[0] < min[0] - EPSILON) |
| 23 | loc |= XPOS & BELOW; |
| 24 | else if (p[0] > max[0] + EPSILON) |
| 25 | loc |= XPOS & ABOVE; |
| 26 | if (p[1] < min[1] - EPSILON) |
| 27 | loc |= YPOS & BELOW; |
| 28 | else if (p[1] > max[1] + EPSILON) |
| 29 | loc |= YPOS & ABOVE; |
| 30 | if (p[2] < min[2] - EPSILON) |
| 31 | loc |= ZPOS & BELOW; |
| 32 | else if (p[2] > max[2] + EPSILON) |
| 33 | loc |= ZPOS & ABOVE; |
| 34 | |
| 35 | return(loc); |
| 36 | } |