FileDocCategorySizeDatePackage
PlaneCircle.javaAPI DocExample1089Wed Apr 20 14:46:26 BST 2005None

PlaneCircle

public 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 booleanisInside(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