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.

11 lines (10 loc) 662 B
import type { ArrayVector2D } from "./types.js"; /** * Calculates the 2D vector angle of a vector pointing at another. * @param {ArrayVector2D} xy1 - First vector as `[x, y]` * @param {ArrayVector2D} xy2 - Second vector as `[x, y]` (target to look at) * @param {number} [m1] - Optional current magnitude of the first vector (default: magnitude2D(xy1)) * @param {number} [m2] - Optional current magnitude of the second vector (default: magnitude2D(xy2)) * @returns {ArrayVector2D} Vector pointing at the target with the magnitude of xy1 */ export declare const lookAt2D: (xy1: ArrayVector2D, xy2: ArrayVector2D, m1?: number, m2?: number) => ArrayVector2D;