private Vector2f lineIntersect(Vector2f lineStart1, Vector2f lineEnd1, Vector2f lineStart2, Vector2f lineEnd2)
    {
        Vector2f line1 = lineEnd1.sub(lineStart1);
        Vector2f line2 = lineEnd2.sub(lineStart2);

        float cross = cross(line1, line2);
        if(cross == 0)
            return null;

        Vector2f distanceBetweenLineStarts = lineStart2.sub(lineStart1);

        float a = cross(distanceBetweenLineStarts, line2) / cross;
        float b = cross(distanceBetweenLineStarts, line1) / cross;

        if(0.0f < a && a < 1.0f && 0.0f < b && b < 1.0f)
            return lineStart1.add(line1.mul(a));

        return null;
    }