← Standard library

Circle

struct Circle
import 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.

Geometry2D.wax:140

Members

centerfield

public float2 center

The center position.

Geometry2D.wax:144

radiusfield

public float radius

The radius, expected to be nonnegative.

Geometry2D.wax:148

constructorconstructor

public constructor (float2 center, float radius)

Stores the center and radius without validation.

Geometry2D.wax:153

areagetter

public get area() : float

Returns pi times radius squared.

Geometry2D.wax:161

circumferencegetter

public get circumference() : float

Returns 2*pi times radius.

Geometry2D.wax:165

boundingRectgetter

public get boundingRect() : Rect

Returns the tight axis-aligned bounding rectangle.

Geometry2D.wax:170

Containsmethod

public fn Contains(float2 point) : bool

Tests whether a point lies inside or on the boundary.

Geometry2D.wax:177

Intersectsmethod

public fn Intersects(Circle other) : bool

Tests whether two balls overlap or touch.

Geometry2D.wax:186

IntersectsRectmethod

public fn IntersectsRect(Rect r) : bool

Tests intersection with an axis-aligned rectangle, including tangency. Supply nonnegative rectangle extents.

Geometry2D.wax:197

ToStringmethod

public fn ToString() : string

Provided by the compiler.

ToStringBuffermethod

public fn ToStringBuffer(StringBuilder builder) : int32

Provided by the compiler.