Skip to main content

CircleDefinition

Class representing a circle definition.

Extends

Constructors

new CircleDefinition()

new CircleDefinition(center, radius): CircleDefinition

Creates an instance of CircleDefinition.

Parameters

center: Point

The center point of the circle.

radius: number

The radius of the circle.

Returns

CircleDefinition

Overrides

ShapeDefinition.constructor

Defined in

definitions/CircleDefinition.ts:20

Properties

center

center: Point

The center point of the circle.

Defined in

definitions/CircleDefinition.ts:9

Accessors

radius

Get Signature

get radius(): number

Gets the radius of the definition.

Returns

number

The radius of the definition.

Set Signature

set radius(radius): void

Sets the radius of the definition.

Throws

RangeError if negative radius is passed.

Parameters

radius: number

The new radius of the definition.

Returns

void

Defined in

definitions/CircleDefinition.ts:35

Methods

toArray()

toArray(): any[]

Converts the object's properties to an array. If any of the properties are objects that implement ISerializable, their toArray method is called.

Returns

any[]

An array representation of the object's properties.

Inherited from

ShapeDefinition.toArray

Defined in

common/Serializable.ts:16


toJson()

toJson(): string

Converts the object to a JSON string. If any of the properties are objects that implement ISerializable, their toJson method is called. Underscores e.g. of private members are trimmed when setting the serialized name.

Returns

string

A JSON string representation of the object.

Inherited from

ShapeDefinition.toJson

Defined in

common/Serializable.ts:32