import { MapObject } from '../models/map-object'; export declare class MathematicsService { /** * Get position snapped to the center of current grid cell (snapped to grid). * @param xy A location of the point to snap. * @param gridSize Size of grid cell. */ getSnappedToGridObjectPos(xy: XY, gridSize: number): XY; /** * Converts degrees to radians. * @param deg Value of degrees. */ toRadians(deg: number): number; /** * Returns a new coordinates of the center of object located at xy, having size w x h. * @param xy Location of left upper object corner. * @param w Width of object. * @param h Height of object. */ centeredPos(xy: XY, w: number, h: number): XY; /** * Returns left upper corner location using xy position of object center, having size w x h. * @param xy Location of center point of object (rotation center). * @param w Width of object. * @param h Height of object. */ decenteredPos(xy: XY, w: number, h: number): XY; objectContainsPoint(obj: MapObject, xy: XY): boolean; /** * Checks object corners including rotation. * @param obj An object to examine. * @param padding Additional padding to add to the target rectangle. */ getObjectCorners(obj: MapObject, padding?: Bounds): XY4; /** * Rotates point around a center by a specified angle in degrees. * @param point Point to rotate. * @param center A position of center point of rotation. * @param angle Angle of rotation in degrees. */ rotatePoint(point: XY, center: XY, angle: number): XY; private calculateTriangleArea; } export declare type XY = { x: number; y: number; }; export declare class XY4 { p1: XY; p2: XY; p3: XY; p4: XY; constructor(p1?: XY, p2?: XY, p3?: XY, p4?: XY); static zero(): XY4; static uniform(p: number): XY4; } export declare class Bounds { top: number; right: number; bottom: number; left: number; constructor(top?: number, right?: number, bottom?: number, left?: number); static zero(): Bounds; static uniform(v: number): Bounds; }