UNPKG

@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.

15 lines (14 loc) 468 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromAngleX2D = void 0; /** * Creates an ArrayVector2D from x-axis angle. * @param {number} phi - Angle in radians * @param {number} magnitude - Optional magnitude of the vector (default: `1`) * @returns {ArrayVector2D} Vector */ const fromAngleX2D = (phi, magnitude = 1) => [ magnitude * Math.cos(phi), magnitude * Math.sin(phi), ]; exports.fromAngleX2D = fromAngleX2D;