PlaneCirclepublic class PlaneCircle extends Circle
Fields Summary |
---|
public double | cx | public double | cy |
Constructors Summary |
---|
public PlaneCircle(double r, double x, double y)
super(r); // Invoke the constructor of the superclass, Circle()
this.cx = x; // Initialize the instance field cx
this.cy = y; // Initialize the instance field cy
|
Methods Summary |
---|
public boolean | isInside(double x, double y)
double dx = x - cx, dy = y - cy; // Distance from center
double distance = Math.sqrt(dx*dx + dy*dy); // Pythagorean theorem
return (distance < r); // Returns true or false
|
|