@fimbul-works/vec
Version:
A comprehensive TypeScript vector math library providing 2D, 3D, and 4D vector operations with a focus on performance and type safety.
11 lines (10 loc) • 421 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.angleZ3D = void 0;
/**
* Gets the angle between a 3D vector and the positive z-axis in radians.
* @param {ArrayVector3D} xyz - Vector as `[x, y, z]`
* @returns {number} Angle in radians, always in the range [0, 2π)
*/
const angleZ3D = (xyz) => Math.atan2(Math.sqrt(xyz[0] ** 2 + xyz[1] ** 2), xyz[2]);
exports.angleZ3D = angleZ3D;