home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
RADIANCE
/
SRC
/
OT
/
PLOCATE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-07
|
794b
|
40 lines
/* Copyright (c) 1986 Regents of the University of California */
#ifndef lint
static char SCCSid[] = "@(#)plocate.c 2.1 11/12/91 LBL";
#endif
/*
* plocate.c - routine to locate 3D vector w.r.t. box.
*
* 8/28/85
*/
#include "fvect.h"
#include "plocate.h"
int
plocate(p, min, max) /* return location of p w.r.t. min & max */
register FVECT p;
FVECT min, max;
{
register int loc = 0;
if (p[0] < min[0] - EPSILON)
loc |= XPOS & BELOW;
else if (p[0] > max[0] + EPSILON)
loc |= XPOS & ABOVE;
if (p[1] < min[1] - EPSILON)
loc |= YPOS & BELOW;
else if (p[1] > max[1] + EPSILON)
loc |= YPOS & ABOVE;
if (p[2] < min[2] - EPSILON)
loc |= ZPOS & BELOW;
else if (p[2] > max[2] + EPSILON)
loc |= ZPOS & ABOVE;
return(loc);
}