Given the line (p0,p1), determine if a point x is located to the left of, on, or to the right of a line (with the function returning >0, ==0, or <0 respectively). The points are assumed 3D points, but projected into one of x-y-z planes; hence the indices axis0 and axis1 specify which plane the computation is to be performed on.
| 713 | // one of x-y-z planes; hence the indices axis0 and axis1 specify which plane |
| 714 | // the computation is to be performed on. |
| 715 | inline double PointLocation(int axis0, int axis1, double* p0, double* p1, double* x) |
| 716 | { |
| 717 | return (((p1[axis0] - p0[axis0]) * (x[axis1] - p0[axis1])) - |
| 718 | ((x[axis0] - p0[axis0]) * (p1[axis1] - p0[axis1]))); |
| 719 | } |
| 720 | } |
| 721 | |
| 722 | //------------------------------------------------------------------------------ |