Circle Class
The Circle object is an area defined by its position, as indicated by its center point (x, y) and by its radius.
Constructor
Circle
-
center
-
radius
Parameters:
-
center
VectorThe point of the center of the circle
-
radius
NumberThe radius of the circle
Item Index
Methods
contains
-
x
-
y
Checks if the x, and y coords passed to this function are contained within this circle, or on the edge of the circle
Parameters:
-
x
NumberThe X coord of the point to test
-
y
NumberThe Y coord of the point to test
Returns:
if the x/y coords are within this polygon
copy
-
circle
Copies the values from another circle to this one
Parameters:
-
circle
CircleThe circle to copy vlaues from
Returns:
Returns itself.
equals
-
circle
Checks if this circle's values are equal to anothers
Parameters:
-
circle
CircleThe circle to check against
Returns:
True if they are equal
overlaps
-
circle
Checks if this circle overlaps another
Parameters:
-
circle
CircleThe circle to check if this overlaps
Returns:
if the circle overlaps
Properties
_radius
Number
private
The unscaled radius of the circle
Default: 0
area
Number
The area of the circle
circumference
Number
The circumference of the circle
radius
Number
The radius of the circle
Default: 0
radius
Number
The radius circle
Default: 0
x
Number
The center X coord of the circle
Default: 0
y
Number
The center Y coord of the circle
Default: 0