Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean linesIntersected(float x1, float y1, float x2, float y2, float x3, float y3, float x4,
- float y4) {
- if ((x1 * y2 + x3 * y1 + x2 * y3 - x3 * y2 - x1 * y3 - x2 * y1)
- * (x1 * y2 + x4 * y1 + x2 * y4 - x4 * y2 - x1 * y4 - x2 * y1) <= 0
- && (x3 * y4 + x1 * y3 + x4 * y1 - x1 * y4 - x3 * y1 - x4 * y3)
- * (x3 * y4 + x2 * y3 + x4 * y2 - x2 * y4 - x3 * y2 - x4 * y3) <= 0)
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement