------------------------------------------------------------------------------ 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
| 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 |
| 65 | static 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 | //------------------------------------------------------------------------------ |
| 73 | void vtkPolyPlane::ComputeNormals() |