Exercise 0 - Circle and Point
Tips
this and CLASS
this and CLASSThe practice of "Tell, Don't Ask"
public boolean contains(Point p) {
return this.c.distanceTo(p) <= this.r;
}import java.lang.Math;
public double distanceTo(Point p) {
double x = this.x - p.x;
double y = this.y - p.y;
return Math.sqrt(x * x + y * y);
}Last updated