@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) • 413 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.angleY4D = void 0;
/**
* Calculates the angle between a 4D vector and the positive y-axis.
* @param {ArrayVector4D} xyzw - Vector as `[x, y, z, w]`
* @returns {number} The angle in radians
*/
const angleY4D = (xyzw) => Math.atan2(Math.sqrt(xyzw[2] ** 2 + xyzw[3] ** 2 + xyzw[0] ** 2), xyzw[1]);
exports.angleY4D = angleY4D;