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

Function leftOf

Common/DataModel/vtkPolyPlane.cxx:65–70  ·  view source on GitHub ↗

------------------------------------------------------------------------------ This function returns 1 if p3 is to the left the directed line from p1 to p2 and -1 otherwise This is computed by testing the determinant: | 1 p1[0] p1[1] | | 1 p2[0] p2[1] | | 1 p3[0] p3[1] | which is positive if p3 is to the left of the directed line from p1 to p2, zero if p3 is on the line and negative if p3 is to th

Source from the content-addressed store, hash-verified

63// zero if p3 is on the line and negative if p3 is to the right of the line.
64// Credit: Jack Snoeyink's computational geometry course at UNC
65static bool leftOf(double p1[2], double p2[2], double p3[2])
66{
67 double tmp =
68 p1[0] * p2[1] + p1[1] * p3[0] + p2[0] * p3[1] - p1[1] * p2[0] - p3[1] * p1[0] - p3[0] * p2[1];
69 return tmp > 0;
70}
71
72//------------------------------------------------------------------------------
73void vtkPolyPlane::ComputeNormals()

Callers 1

EvaluateFunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected