Example #1
0
  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;
  }
Example #2
0
 public Circulo(Circulo c) {
   this(c.getX(), c.getY(), c.getRaio());
 }
Example #3
0
 public int compareTo(Circulo c) {
   if (this.raio == c.getRaio() && this.centro.compareTo(c.centro) == 1) return 1;
   else return 0;
 }
Example #4
0
 public double calcularArea(Circulo c) {
   return (c.getRaio() * c.getRaio()) * Math.PI;
 }
Example #5
0
 public double calcularPerimetro(Circulo c) {
   return 2 * Math.PI * c.getRaio();
 }
Example #6
0
 public Circulo(Circulo c) {
   this(c.centro, c.getRaio());
 }