import { assert } from "../../assert.js";
import { v2_length_sqr } from "./v2_length_sqr.js";

/**
 * Squared distance between two points in 2d space
 * @param {number} x0
 * @param {number} y0
 * @param {number} x1
 * @param {number} y1
 * @returns {number}
 */
export function v2_distance_sqr(x0, y0, x1, y1) {
    assert.isNumber(x0, 'x0');
    assert.isNumber(y0, 'x0');
    assert.isNumber(x1, 'x0');
    assert.isNumber(y1, 'x0');

    return v2_length_sqr(x1 - x0, y1 - y0);
}