Circle

Represents a circle shape with position and radius.

Constructor

  • Circle(pos: Vec2, radius: SupportsFloat) Circle
  • Circle(
        x: SupportsFloat,
        y: SupportsFloat,
        radius: SupportsFloat
    ) Circle

Represents a circle shape with position and radius.

Properties


NameDescriptionType
areaReturn the area of the circle.float
circumferenceReturn the circumference of the circle.float
posThe center position of the circle as a Vec2.Vec2
radiusThe radius of the circle.float

Methods


As Rect

as_rect() Rect

Return the smallest rectangle that fully contains the circle.

Copy

copy() Circle

Return a copy of the circle.