public boolean intercepta(Circulo c) { double limiteMin = this.raio + c.getRaio(), difX = this.centro.getX() - c.centro.getX(), difY = this.centro.getY() - c.centro.getY(); double h = Math.sqrt((difX * difX) + (difY * difY)); if (h < limiteMin) { // rever esta formula.... if (h + this.raio >= c.getRaio() || (h + c.getRaio() >= this.raio)) return true; else return false; } return false; }
public Circulo(Circulo c) { this(c.getX(), c.getY(), c.getRaio()); }
public int compareTo(Circulo c) { if (this.raio == c.getRaio() && this.centro.compareTo(c.centro) == 1) return 1; else return 0; }
public double calcularArea(Circulo c) { return (c.getRaio() * c.getRaio()) * Math.PI; }
public double calcularPerimetro(Circulo c) { return 2 * Math.PI * c.getRaio(); }
public Circulo(Circulo c) { this(c.centro, c.getRaio()); }