function checkIntersection works, but we need to paint the triangle to see how and if it really works