The DEA geometry is defined by a set of points and vectors, all of them in the MPS coordinates-
The DEA face is a plane (a two-dimensional surface), so a point on the face of DEA has two "DEA-local" coordinates- localX and localY. The depth of a point inside the DEA is given by the third "DEA-local" coordinate- localZ.
The conversion between the MPS coordinates and the "DEA-local" coordinates is given by the formulas:
vector3_t mps,local; --- 3D points vector3_t xv,yv,normalv; --- 3D vectors mps.x = origin.x + xv.x * local.x + yv.x * local.y + normalv.x * local.z; mps.y = origin.y + xv.y * local.x + yv.y * local.y + normalv.y * local.z; mps.z = origin.z + xv.z * local.x + yv.z * local.y + normalv.z * local.z;The inverse conversion is given by:
local.x = DotProduct(mps-origin,xv); local.y = DotProduct(mps-origin,yv); local.z = DotProduct(mps-origin,normalv);
The boundaries of the DEA segments are defined by constraining the "DEA-local" coordinates to the inside of a square box:
xMin <= local.x <= xMax yMin <= local.y <= yMax 0 <= local.z <= depth
To find out if a point specified in the MPS coordinates is inside or outside of a DEA segment, one has to convert the coordinates of this point to the "DEA-local" coordinates and check if the "DEA-local" coordinates (local.x and local.y) lay inside the boundaries (xMin, xMax, yMin and yMax) of that particular segment.