import { xFindClosestIndex } from "../x/index.js";
/**
 * Finds the closest point
 * @param data - x array should be sorted and ascending
 * @param target - target to search
 * @returns - closest point
 */
export function xyFindClosestPoint(
/** points */
data, target) {
    const { x, y } = data;
    const index = xFindClosestIndex(x, target);
    return {
        x: x[index],
        y: y[index],
    };
}
//# sourceMappingURL=xyFindClosestPoint.js.map