"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Distance = void 0;
var Vec3_1 = require("../math/Vec3");
var vector_1 = __importDefault(require("../math/vector"));
/*
 * @Description  :  如无必要，勿增实体
 * @Author       : 赵耀圣
 * @QQ           : 549184003
 * @Date         : 2021-09-30 10:54:56
 * @LastEditTime : 2021-09-30 10:59:50
 * @FilePath     : \cga.js\src\alg\distance.ts
 */
var _vec3_1 = new Vec3_1.Vec3();
var Distance = /** @class */ (function () {
    function Distance() {
    }
    Distance.Point2Point_Number = function (x0, y0, z0, x1, y1, z1) {
        return vector_1.default.distance(x0, y0, z0, x1, y1, z1);
    };
    Distance.Point2Line_Number = function (x0, y0, z0, sox, soy, soz, sdx, sdy, sdz) {
    };
    /**
     *
     * @param point
     * @param origin
     * @param dir 默认已经正交化
     */
    Distance.Point2Line_Vec3 = function (point, origin, dir, result) {
        if (result === void 0) { result = new Vec3_1.Vec3; }
        result.copy(point).sub(origin);
        var len = result.dot(dir);
        result.copy(dir).multiplyScalar(len);
        result.add(point);
        return result;
    };
    return Distance;
}());
exports.Distance = Distance;
