| Constructor and Description |
|---|
XyEllipse(XyPoint center,
double a,
double b)
Creates a new XyEllipse with the given center, horizontal radius (a), and
vertical radius (b).
|
XyEllipse(XyPoint center,
double a,
double b,
XyRotation rotation)
Creates a new XyEllipse with the given center, horizontal radius (a), and
vertical radius (b).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(XyPoint point)
Tests if a point is inside this area.
|
static XyEllipse |
ellipse(XyRectangle rectangle)
Creates a new XyEllipse bounded by the given XyRectangle.
|
boolean |
equals(java.lang.Object nother) |
double |
getA()
The a parameter, which is half the length of the major (longest) axis.
|
double |
getArea()
Returns the 2-dimensional area covered by this...
|
double |
getB()
The b parameter, which is half the length of the minor (shortest) axis.
|
XyBounds |
getBounds()
Returns an XyBounds object representing the rectangular extents of this
shape.
|
XyPoint |
getCenter()
The center of the ellipse.
|
double |
getEccentricity()
The eccentricity of the ellipse.
|
XyPoint |
getLeftFocus()
The "left" focus.
|
double |
getPerimeter()
Returns the total length of the lines and/or curves bounding the area.
|
XyPoint |
getRightFocus()
The "right" focus.
|
XyRotation |
getRotation()
The angle of rotation of the major axis.
|
java.util.Iterator<XyPoint> |
iterator() |
XyEllipse |
scaledBy(double factor)
Return a scaled version of the shape by multiplying all coordinates by
the given factor in both dimensions.
|
XyPolygon |
toPolygon()
Same as
XyArea.toPolygon(XyAngle) with a default angle granularity of
1/60 circle (1 degree, pi/30 radians). |
XyPolygon |
toPolygon(XyAngle granularity)
Converts the ellipse to a polygon with the given number of vertices.
|
java.lang.String |
toString() |
XyShape |
transformedBy(XyTransform transform)
Transform the shape using the given transform.
|
XyEllipse |
translatedBy(double offsetX,
double offsetY)
Translate the shape by adding all coordinates to the given x and y
offsets.
|
public XyEllipse(XyPoint center, double a, double b)
public XyEllipse(XyPoint center, double a, double b, XyRotation rotation)
public static XyEllipse ellipse(XyRectangle rectangle)
public XyPolygon toPolygon(XyAngle granularity)
public XyPolygon toPolygon()
XyAreaXyArea.toPolygon(XyAngle) with a default angle granularity of
1/60 circle (1 degree, pi/30 radians).public boolean contains(XyPoint point)
XyAreapublic double getArea()
XyAreapublic double getPerimeter()
XyAreagetPerimeter in interface XyArea<XyEllipse>public XyBounds getBounds()
XyShapepublic XyEllipse scaledBy(double factor)
XyShapepublic XyShape transformedBy(XyTransform transform)
XyShapetransformedBy in interface XyShape<XyEllipse>transform - affine transform to apply.public XyEllipse translatedBy(double offsetX, double offsetY)
XyShapetranslatedBy in interface XyShape<XyEllipse>offsetX - offset for the x dimensionoffsetY - offset for the y dimensionpublic java.util.Iterator<XyPoint> iterator()
iterator in interface java.lang.Iterable<XyPoint>public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object nother)
equals in class java.lang.Objectpublic double getA()
public double getB()
public XyRotation getRotation()
public XyPoint getCenter()
public double getEccentricity()
public XyPoint getLeftFocus()
public XyPoint getRightFocus()