import { Quaternion } from "./Quaternion.js";
export class Euler {
    x;
    y;
    z;
    order;
    constructor(x = 0, y = 0, z = 0, order = "XYZ") {
        this.x = x;
        this.y = y;
        this.z = z;
        this.order = order;
        if (![x, y, z].every(Number.isFinite))
            throw new RangeError("Euler angles must be finite.");
        if (order !== "XYZ")
            throw new RangeError(`Unsupported Euler order: ${order}`);
    }
    toQuaternion() {
        return Quaternion.fromEuler(this.x, this.y, this.z, this.order);
    }
    equals(euler, epsilon = 1e-10) {
        return (Math.abs(this.x - euler.x) <= epsilon &&
            Math.abs(this.y - euler.y) <= epsilon &&
            Math.abs(this.z - euler.z) <= epsilon &&
            this.order === euler.order);
    }
    toArray() {
        return [this.x, this.y, this.z];
    }
}
//# sourceMappingURL=Euler.js.map