Title | Solucion del ejercicio 2 breve |
---|---|
Author | Gonzalo Garcia |
Course | Programación II |
Institution | Universidad Politécnica de Madrid |
Pages | 4 |
File Size | 131.5 KB |
File Type | |
Total Downloads | 3 |
Total Views | 131 |
Programacion Java...
public class Punto { private double x; private double y; public Punto( double x, double y){ this.x = x; thi this.y = y; } public double calcDistanciaA( Punto otro ){ ret rn Math.sqrt(Math.pow(this.x-otro.x,2)+ return Math sqrt(Math po (this otro 2)+ Math.pow(this.y-otro.y,2)); } }
public class Circulo { private Punto centro; private double radio; public Circulo( Punto centro, double radio ){ this.centro = centro; this.radio = radio; }
Sielradiodethis es menorqueelde otro =>this no puedeincluiraotro
public boolean incluyeA( Circulo otro ){ ){ if ( this.radio < otro.radio ) return false; return this.centro.calcDistanciaA(otro.centro) + otro.radio...