MCPcopy Create free account
hub / github.com/Kitware/VTK / PointLocation

Function PointLocation

Common/DataModel/vtkPolygon.cxx:715–719  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

713// one of x-y-z planes; hence the indices axis0 and axis1 specify which plane
714// the computation is to be performed on.
715inline 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//------------------------------------------------------------------------------

Callers 1

PointInPolygonMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected