public class Circle extends Ellipse
Modifier and Type | Field and Description |
---|---|
float |
radius
The radius of the circle
|
DEFAULT_SEGMENT_COUNT
boundingCircleRadius, center, maxX, maxY, minX, minY, points, pointsDirty, trianglesDirty, tris, x, y
Constructor and Description |
---|
Circle(float centerPointX,
float centerPointY,
float radius)
Create a new circle based on its radius
|
Circle(float centerPointX,
float centerPointY,
float radius,
int segmentCount)
Create a new circle based on its radius
|
Modifier and Type | Method and Description |
---|---|
protected void |
calculateRadius()
Calculate the radius of a circle that can completely enclose this shape.
|
boolean |
contains(float x,
float y)
Check if a point is contained by this circle
|
protected void |
findCenter()
Get the center of this polygon.
|
float[] |
getCenter()
Get the coordinates of the center of the circle
|
float |
getCenterX()
Get the x coordinate of the centre of the circle
|
float |
getCenterY()
Get the y coordinate of the centre of the circle
|
float |
getRadius()
Get the radius of the circle
|
boolean |
intersects(Shape shape)
Check if this circle touches another
|
void |
setRadius(float radius)
Set the radius of this circle
|
createPoints, getRadius1, getRadius2, setRadii, setRadius1, setRadius2, transform
calculateTriangles, checkPoints, closed, contains, getBoundingCircleRadius, getHeight, getLocation, getMaxX, getMaxY, getMinX, getMinY, getNormal, getPoint, getPointCount, getPoints, getTriangles, getWidth, getX, getY, hasVertex, includes, increaseTriangulation, indexOf, preCache, prune, setCenterX, setCenterY, setLocation, setLocation, setX, setY, subtract, union
public Circle(float centerPointX, float centerPointY, float radius)
centerPointX
- The x location of the center of the circlecenterPointY
- The y location of the center of the circleradius
- The radius of the circlepublic Circle(float centerPointX, float centerPointY, float radius, int segmentCount)
centerPointX
- The x location of the center of the circlecenterPointY
- The y location of the center of the circleradius
- The radius of the circlesegmentCount
- The number of segments to build the circle out ofpublic float getCenterX()
getCenterX
in class Shape
public float getCenterY()
getCenterY
in class Shape
public float[] getCenter()
public void setRadius(float radius)
radius
- The radius of this circlepublic float getRadius()
public boolean intersects(Shape shape)
intersects
in class Shape
shape
- The other circlepublic boolean contains(float x, float y)
protected void findCenter()
Shape
findCenter
in class Ellipse
protected void calculateRadius()
Shape
calculateRadius
in class Ellipse