Source code for above example


val circle = Circle(x, y, radius)

circle.draw() - draws the circle with the current fill and stroke properties

circle.origin() - Point at center of circle

circle.contains(point) - Boolean, true if point is within the circle circumference

circle.collides(otherCircle) - Boolean, true if there's a collision

val d = circle.originDistance(otherCircle) - Float, distance from x,y to other circle origin

val d = circle.edgeDistance(otherCircle) - Float, distance the edge of this circe to the edge of another, or 0f if they're touching

val p = circle.edgePoint(otherPoint) - Point on circumference between circle origin and another point