@irysius/grid-math
Version:
Tools to assist with grid math and algorithms
18 lines • 970 B
TypeScript
declare module "@irysius/grid-math/Vector2" {
export interface IVector2 {
x: number;
y: number;
type?: string;
}
export function create(x: number, y: number, type?: string): IVector2;
export function zero(type?: string): IVector2;
export function unit(type?: string): IVector2;
export function isVector2(v: any, typeToCheck?: string | any): v is IVector2;
export function add<T extends IVector2, U extends IVector2 = T>(a: T, b: U): T;
export function subtract<T extends IVector2, U extends IVector2 = T>(a: T, b: U): T;
export function multiply<T extends IVector2>(v: T, k: number): T;
export function negate<T extends IVector2>(v: T): T;
export function areEqual(a: IVector2, b: IVector2, ignoreType?: boolean): boolean;
export function closeEnough(e: number): (a: IVector2, b: IVector2, ignoreType?: boolean) => boolean;
export function clone<T extends IVector2>(v: T): T;
}