FileDocCategorySizeDatePackage
Ellipse2D.javaAPI DocAndroid 1.5 API12960Wed May 06 22:41:54 BST 2009java.awt.geom

Ellipse2D

public abstract class Ellipse2D extends RectangularShape
The Class Ellipse2D describes an ellipse defined by a rectangular area in which it is inscribed.
since
Android 1.0

Fields Summary
Constructors Summary
protected Ellipse2D()
Instantiates a new Ellipse2D.

    
Methods Summary
public booleancontains(double px, double py)

        if (isEmpty()) {
            return false;
        }

        double a = (px - getX()) / getWidth() - 0.5;
        double b = (py - getY()) / getHeight() - 0.5;

        return a * a + b * b < 0.25;
    
public booleancontains(double rx, double ry, double rw, double rh)

        if (isEmpty() || rw <= 0.0 || rh <= 0.0) {
            return false;
        }

        double rx1 = rx;
        double ry1 = ry;
        double rx2 = rx + rw;
        double ry2 = ry + rh;

        return contains(rx1, ry1) && contains(rx2, ry1) && contains(rx2, ry2) && contains(rx1, ry2);
    
public java.awt.geom.PathIteratorgetPathIterator(java.awt.geom.AffineTransform at)

        return new Iterator(this, at);
    
public booleanintersects(double rx, double ry, double rw, double rh)

        if (isEmpty() || rw <= 0.0 || rh <= 0.0) {
            return false;
        }

        double cx = getX() + getWidth() / 2.0;
        double cy = getY() + getHeight() / 2.0;

        double rx1 = rx;
        double ry1 = ry;
        double rx2 = rx + rw;
        double ry2 = ry + rh;

        double nx = cx < rx1 ? rx1 : (cx > rx2 ? rx2 : cx);
        double ny = cy < ry1 ? ry1 : (cy > ry2 ? ry2 : cy);

        return contains(nx, ny);