UNPKG

@obliczeniowo/elementary

Version:
22 lines (21 loc) 786 B
import { ColorType } from '../colors/color-interface'; import { Point2D } from '../vectors/Point2D'; import { Rectangle } from './rectangle'; interface IDrawPolyline { drawPolyline: (points: Point2D[], stroke: number, color: ColorType, options?: { close?: boolean; [key: string]: any; }) => {}; } export declare class Polygon { static random: (spaceWidth: number, spaceHeight: number, size?: number) => Polygon; points: Point2D[]; constructor(points?: Point2D[]); getBondingRect(): Rectangle; isPointIn(point: Point2D): boolean; isIntersect(polygon?: Polygon): boolean; subtract(point: Point2D): Polygon; multiply(scalar: number): Polygon; drawPolygon(ctx: IDrawPolyline, stroke: number, color: ColorType): void; } export {};