wir haben im rahmen eines projektes 2 kreise geschnitten und die schnittpunkte ermittelt...
versucht nicht den code zu verstehen, sondern kopiert ihn höchstens (es hat keinen sinn - zu kompliziert *gg*)
x1 = (Math.sqrt( -Math.pow(mx1, 4) + 4 * Math.pow(mx1, 3) * mx2 +
2 * Math.pow(mx1, 2) *
(Math.pow(r1, 2) - Math.pow(my1, 2) + 2 * my1 * my2 -
Math.pow(my2, 2) - 3 * Math.pow(mx2, 2) +
Math.pow(r2, 2)) -
4 * mx1 * mx2 *
(Math.pow(r1, 2) - Math.pow(my1, 2) + 2 * my1 * my2 -
Math.pow(my2, 2) - Math.pow(mx2, 2) + Math.pow(r2, 2)) -
Math.pow(r1, 4) +
2 * Math.pow(r1, 2) *
(Math.pow(my1, 2) - 2 * my1 * my2 + Math.pow(my2, 2) +
Math.pow(mx2, 2) + Math.pow(r2, 2)) - Math.pow(my1, 4) +
4 * Math.pow(my1, 3) * my2 -
2 * Math.pow(my1, 2) *
(3 * Math.pow(my2, 2) + Math.pow(mx2, 2) -
Math.pow(r2, 2)) +
4 * my1 * my2 *
(Math.pow(my2, 2) + Math.pow(mx2, 2) - Math.pow(r2, 2)) -
Math.pow(Math.pow(my2, 2) + Math.pow(mx2, 2) -
Math.pow(r2, 2), 2)) * Math.abs(my1 - my2) +
Math.pow(mx1, 3) - Math.pow(mx1, 2) * mx2 -
mx1 *
(Math.pow(r1, 2) - Math.pow(my1, 2) + 2 * my1 * my2 -
Math.pow(my2, 2) + Math.pow(mx2, 2) - Math.pow(r2, 2)) +
mx2 *
(Math.pow(r1, 2) + Math.pow(my1, 2) - 2 * my1 * my2 +
Math.pow(my2, 2) + Math.pow(mx2, 2) - Math.pow(r2, 2))) /
(2 * (Math.pow(mx1, 2) - 2 * mx1 * mx2 + Math.pow(my1, 2) -
2 * my1 * my2 + Math.pow(my2, 2) + Math.pow(mx2, 2)));
x2 = -(Math.sqrt( -Math.pow(mx1, 4) + 4 * Math.pow(mx1, 3) * mx2 +
2 * Math.pow(mx1, 2) *
(Math.pow(r1, 2) - Math.pow(my1, 2) + 2 * my1 * my2 -
Math.pow(my2, 2) - 3 * Math.pow(mx2, 2) +
Math.pow(r2, 2)) -
4 * mx1 * mx2 *
(Math.pow(r1, 2) - Math.pow(my1, 2) + 2 * my1 * my2 -
Math.pow(my2, 2) - Math.pow(mx2, 2) + Math.pow(r2, 2)) -
Math.pow(r1, 4) +
2 * Math.pow(r1, 2) *
(Math.pow(my1, 2) - 2 * my1 * my2 + Math.pow(my2, 2) +
Math.pow(mx2, 2) + Math.pow(r2, 2)) - Math.pow(my1, 4) +
4 * Math.pow(my1, 3) * my2 -
2 * Math.pow(my1, 2) *
(3 * Math.pow(my2, 2) + Math.pow(mx2, 2) -
Math.pow(r2, 2)) +
4 * my1 * my2 *
(Math.pow(my2, 2) + Math.pow(mx2, 2) - Math.pow(r2, 2)) -
Math.pow(Math.pow(my2, 2) + Math.pow(mx2, 2) -
Math.pow(r2, 2), 2)) * Math.abs(my1 - my2) -
Math.pow(mx1, 3) + Math.pow(mx1, 2) * mx2 +
mx1 *
(Math.pow(r1, 2) - Math.pow(my1, 2) + 2 * my1 * my2 -
Math.pow(my2, 2) + Math.pow(mx2, 2) - Math.pow(r2, 2)) -
mx2 *
(Math.pow(r1, 2) + Math.pow(my1, 2) - 2 * my1 * my2 +
Math.pow(my2, 2) + Math.pow(mx2, 2) - Math.pow(r2, 2))) /
(2 * (Math.pow(mx1, 2) - 2 * mx1 * mx2 + Math.pow(my1, 2) -
2 * my1 * my2 + Math.pow(my2, 2) + Math.pow(mx2, 2)));
y1 = Math.sqrt(Math.pow(r1, 2) - Math.pow(x1 - mx1, 2)) + my1;
y2 = Math.sqrt(Math.pow(r1, 2) - Math.pow(x2 - mx1, 2)) + my1;
System.out.println("x1, y1: " + x1 + " " + y1);
System.out.println("x2, y2: " + x2 + " " + y2);