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

/**
 * Distance between two vectors
 * @param {number} x0 first vector X
 * @param {number} y0 first vector Y
 * @param {number} x1 second vector X
 * @param {number} y1 second vector Y
 * @returns {number} euclidean distance between vectors
 */
export function v2_distance(x0, y0, x1, y1) {

    assert.isNumber(x0, 'x0');
    assert.isNumber(y0, 'x0');
    assert.isNumber(x1, 'x0');
    assert.isNumber(y1, 'x0');

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