export default class FSMath {
    static add(a, b) {
        return {
            x: a.x + b.x,
            y: a.y + b.y,
            z: a.z + b.z
        };
    }
    static subtract(a, b) {
        return {
            x: a.x - b.x,
            y: a.y - b.y,
            z: a.z - b.z
        };
    }
    static scale(a, b) {
        return {
            x: a.x * b,
            y: a.y * b,
            z: a.z * b
        };
    }
    static magnitudeSquared(a) {
        return a.x * a.x + a.y * a.y + a.z * a.z;
    }
    static magnitude(a) {
        return Math.sqrt(FSMath.magnitudeSquared(a));
    }
    static normalizeToUnitVector(a) {
        return FSMath.scale(a, 1 / (FSMath.magnitude(a) || 1));
    }
    static dot(a, b) {
        return a.x * b.x + a.y * b.y + a.z * b.z;
    }
    static cross(a, b) {
        return {
            x: a.y * b.z - a.z * b.y,
            y: a.z * b.x - a.x * b.z,
            z: a.x * b.y - a.y * b.x
        };
    }
    static distance(a, b) {
        return Math.sqrt(FSMath.distanceSquared(a, b));
    }
    static distanceSquared(a, b) {
        const dx = a.x - b.x;
        const dy = a.y - b.y;
        const dz = a.z - b.z;
        return dx * dx + dy * dy + dz * dz;
    }
    static calculateRotationToFace2D(from, to) {
        const direction = FSMath.subtract(to, from);
        const yaw = Math.atan2(-direction.z, direction.x); 
        const yawDegrees = FSMath.radiansToDegrees(yaw) + 90; 
        return { x: yawDegrees, y: 0, z: 0 };
    }
    static radiansToDegrees(radians) {
        return radians * (180 / Math.PI);
    }
    static angleBetweenLocations(a, b) {
        const dx = b.x - a.x;
        const dz = b.z - a.z;
        const angle = Math.atan2(dz, dx);
        const angleDegrees = FSMath.radiansToDegrees(angle);
        return { x: angleDegrees, y: 0 };
    }
}

//# sourceMappingURL=../../../../_SBUNK_BPDebug/fs_sbunk/fs/FSMath.js.map
