public class Ellipse extends Shape
Shape
contract. The ellipse is actually an approximation using
a series of points generated around the contour of the ellipse.Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_SEGMENT_COUNT
Default number of segments to draw this ellipse with
|
boundingCircleRadius, center, maxX, maxY, minX, minY, points, pointsDirty, trianglesDirty, tris, x, y
Constructor and Description |
---|
Ellipse(float centerPointX,
float centerPointY,
float radius1,
float radius2)
Creates a new Ellipse object.
|
Ellipse(float centerPointX,
float centerPointY,
float radius1,
float radius2,
int segmentCount)
Creates a new Ellipse object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
calculateRadius()
Calculate the radius of a circle that can completely enclose this shape.
|
protected void |
createPoints()
Generate the points to outline this ellipse.
|
protected void |
findCenter()
Get the center of this polygon.
|
float |
getRadius1()
Get the horizontal radius of the ellipse
|
float |
getRadius2()
Get the vertical radius of the ellipse
|
void |
setRadii(float radius1,
float radius2)
Change the shape of this Ellipse
|
void |
setRadius1(float radius1)
Set the horizontal radius of the ellipse
|
void |
setRadius2(float radius2)
Set the vertical radius of the ellipse
|
Shape |
transform(Transform transform)
Apply a transformation and return a new shape.
|
calculateTriangles, checkPoints, closed, contains, contains, getBoundingCircleRadius, getCenter, getCenterX, getCenterY, getHeight, getLocation, getMaxX, getMaxY, getMinX, getMinY, getNormal, getPoint, getPointCount, getPoints, getTriangles, getWidth, getX, getY, hasVertex, includes, increaseTriangulation, indexOf, intersects, preCache, prune, setCenterX, setCenterY, setLocation, setLocation, setX, setY, subtract, union
protected static final int DEFAULT_SEGMENT_COUNT
public Ellipse(float centerPointX, float centerPointY, float radius1, float radius2)
centerPointX
- x coordinate of the center of the ellipsecenterPointY
- y coordinate of the center of the ellipseradius1
- horizontal radiusradius2
- vertical radiuspublic Ellipse(float centerPointX, float centerPointY, float radius1, float radius2, int segmentCount)
centerPointX
- x coordinate of the center of the ellipsecenterPointY
- y coordinate of the center of the ellipseradius1
- horizontal radiusradius2
- vertical radiussegmentCount
- how fine to make the ellipse.public void setRadii(float radius1, float radius2)
radius1
- horizontal radiusradius2
- vertical radiuspublic float getRadius1()
public void setRadius1(float radius1)
radius1
- The horizontal radius to setpublic float getRadius2()
public void setRadius2(float radius2)
radius2
- The vertical radius to setprotected void createPoints()
createPoints
in class Shape
public Shape transform(Transform transform)
Shape
protected void findCenter()
Shape
findCenter
in class Shape
protected void calculateRadius()
Shape
calculateRadius
in class Shape