Circle

A representation of a circle shape with basic geometric operations and collision detection.

Constructor

Circle(pos: Vec2, radius: float)

Parameters

  • pos : Center position of the circle.
  • radius : Radius of the circle.

Properties


NameDescriptionType
posThe circle's positionVec2
radiusThe circle's radiusfloat
areaThe area of the circlefloat
circumferenceThe circumference of the circlefloat

Methods


As Rect

as_rect() Rect

Get the bounding rectangle of the circle.

Returns

Rect : The bounding rectangle of the circle.

Copy

copy() Circle

Create a copy of the circle.

Returns

Circle : A new circle with the same properties.