Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public class KreisMain {
  2.  
  3. public static void main(String[] args) {
  4.  
  5. Kreis Kreis1 = new Kreis();
  6. Kreis Kreis2 = new Kreis();
  7.  
  8. double x = Kreis2.x - Kreis1.x;
  9. double y = Kreis2.y - Kreis1.y;
  10. double radius = Kreis2.radius - Kreis1.radius;
  11.  
  12. double a = (x * x) + (y * y);
  13. double A = Math.sqrt(a);
  14.  
  15. if (a < radius) {
  16.  
  17. System.out.println("Die Kreise überschneiden sich.");
  18.  
  19. } else {
  20. System.out.println("Die Kreise überschneiden sich nicht.");
  21. }
  22.  
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement