void FindTriangleIntersections(Point[] triangle, int index)
{
// PLEASE NOTE: Handling of component comparison is tightly associated with the implementation
// of the findRegion() function. That means when the point to be compared equals
// the pivot point the triangle must be put at least into region 2.
// Linear equations are in parametric form.
// m_pivot.dx = triangle[0].dx + t * (triangle[1].dx - triangle[0].dx)
// m_pivot.dy = triangle[0].dy + t * (triangle[1].dy - triangle[0].dy)
int k = 2;
double dx, dy;
// Iterate through all triangle laterals and find bounding box intersections
for (int i = 0; i < 3; k = i++)
{
dx = triangle[i].X - triangle[k].X;
dy = triangle[i].Y - triangle[k].Y;
if (dx != 0.0)
{
FindIntersectionsWithX(dx, dy, triangle, index, k);
}
if (dy != 0.0)
{
FindIntersectionsWithY(dx, dy, triangle, index, k);
}
}
}