Помогите пожалуйста понять почему не проходит метод "isIntersec". По Пифагору вроде бы все правильно и при попадании центра одного круга на край другого должно выходить true. Где я ошибся?
boolean isIntersec(BaseObject o){
double maxR = this.radius > o.radius ? this.radius : o.radius;
double dist = Math.abs(this.x - o.x)+ Math.abs(this.y -o.y);
if (Math.abs(maxR) <= dist) return true;
else return false;
}
package com.javarush.task.task24.task2413;
import java.util.List;
public class Arkanoid {
static Arkanoid game;
public static void main (String[] args){
}
private Ball ball;
private Stand stand;
private List<Brick> bricks;
public Ball getBall() {
return ball;
}
public Stand getStand() {
return stand;
}
public List<Brick> getBricks() {
return bricks;
}
public void setBall(Ball ball) {
this.ball = ball;
}
public void setStand(Stand stand) {
this.stand = stand;
}
public void setBricks(List<Brick> bricks) {
this.bricks = bricks;
}
public Arkanoid(int width, int height) {
this.width = width;
this.height = height;
}
private int width;
private int height;
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public void setWidth(int width) {
this.width = width;
}
public void setHeight(int height) {
this.height = height;
}
void run() { }
void move(){}
}