Skip to main content

Class: Point

dg.Point

Represents a point.

Implements

Constructors

constructor

new Point(x, y)

Parameters

NameType
xnumber
ynumber

Defined in

src/grid.ts:27

Properties

x

x: number

Implementation of

IPoint.x

Defined in

src/grid.ts:24


y

y: number

Implementation of

IPoint.y

Defined in

src/grid.ts:25

Methods

distanceTo

distanceTo(p): number

Distance to the specified point.

Parameters

NameType
pPoint

Returns

number

Defined in

src/grid.ts:38


fromXY

Static fromXY(xy): Point

Creates a point from an [x, y] array

Parameters

NameType
xynumber[]

Returns

Point

Defined in

src/grid.ts:33


getBounds

Static getBounds(points): Rect

Returns the bounding rectangle for the specified points.

Parameters

NameType
pointsIPoint[]

Returns

Rect

Defined in

src/grid.ts:43