import { line3_compute_segment_point_distance_sqr } from "./line3_compute_segment_point_distance_sqr.js";

/**
 *
 * @param {number} x0
 * @param {number} y0
 * @param {number} z0
 * @param {number} x1
 * @param {number} y1
 * @param {number} z1
 * @param {number} px
 * @param {number} py
 * @param {number} pz
 * @returns {number}
 */
export function line3_compute_segment_point_distance(
    x0, y0, z0,
    x1, y1, z1,
    px, py, pz
) {
    const d2 = line3_compute_segment_point_distance_sqr(x0, y0, z0, x1, y1, z1, px, py, pz);

    return Math.sqrt(d2);
}