UNPKG

diginext-utils

Version:
18 lines 563 B
/** * Calculates the Euclidean distance between two points in 2D space. * Returns 0 if the result is not finite. * * @param x1 - X coordinate of first point * @param y1 - Y coordinate of first point * @param x2 - X coordinate of second point * @param y2 - Y coordinate of second point * @returns The distance between the two points * * @example * ```ts * distance(0, 0, 3, 4); // 5 * distance(1, 1, 4, 5); // 5 * ``` */ export declare function distance(x1: number, y1: number, x2: number, y2: number): number; //# sourceMappingURL=distance.d.ts.map