@dominicstop/utils
Version:
Yet another event emitter written in typescript.
54 lines • 1.81 kB
TypeScript
import { Cloneable } from "../types/Cloneable";
import { ValueRepresentable } from "../types/ValueRepresentable";
import { Angle } from "./Angle";
import { Line } from "./Line";
import { Rect } from "./Rect";
import { Vector2D } from "./Vector2D";
export type PointValue = {
x: number;
y: number;
};
export declare class Point implements Cloneable<Point>, ValueRepresentable<PointValue> {
x: number;
y: number;
epsilon: number;
constructor(args: PointValue);
get asValue(): PointValue;
get asVector(): Vector2D;
get magnitude(): number;
get normalized(): Vector2D;
clone(): Point;
isEqualToOtherPoint(otherPoint: Point): boolean;
get isZero(): boolean;
get isNaN(): boolean;
toString(): string;
createLine(otherPoint: Point): Line;
getDistance(otherPoint: Point): number;
getDelta(otherPoint: Point): Point;
getSum(...otherPoints: Array<Point>): Point;
getMidpointBetweenOtherPoint(otherPoint: Point): Point;
rotateRelativeToCenterPoint(args: {
angle: Angle;
center: Point;
}): void;
rotatedRelativeToCenterPoint(args: {
angle: Angle;
center: Point;
}): Point;
static get zero(): Point;
static lerp(valueStart: Point, valueEnd: Point, percent: number): Point;
static getBoundingBoxForPoints(points: Array<Point>): Rect;
static translatePoints(args: {
points: Array<Point>;
dx: number;
dy: number;
}): Array<Point>;
static sumOfAllPoints(...points: Array<Point>): Point;
static getDistanceBetweenTwoPoints(pointA: Point, pointB: Point): number;
static rotatePointsRelativeToCenter(args: {
points: Array<Point>;
rotationAmount: Angle;
center: Point;
}): Array<Point>;
}
//# sourceMappingURL=Point.d.ts.map