Circle
struct Circleimport Circle from Wax;A 2D ball described by a center and radius. Supply a finite, nonnegative radius; construction does not validate it. Containment and intersection include the boundary.
Members
centerfield
public float2 centerThe center position.
radiusfield
public float radiusThe radius, expected to be nonnegative.
constructorconstructor
public constructor (float2 center, float radius)Stores the center and radius without validation.
areagetter
public get area() : floatReturns pi times radius squared.
circumferencegetter
public get circumference() : floatReturns 2*pi times radius.
boundingRectgetter
public get boundingRect() : RectReturns the tight axis-aligned bounding rectangle.
Containsmethod
public fn Contains(float2 point) : boolTests whether a point lies inside or on the boundary.
Intersectsmethod
public fn Intersects(Circle other) : boolTests whether two balls overlap or touch.
IntersectsRectmethod
public fn IntersectsRect(Rect r) : boolTests intersection with an axis-aligned rectangle, including tangency. Supply nonnegative rectangle extents.
ToStringmethod
public fn ToString() : stringProvided by the compiler.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Provided by the compiler.