jumpstorm/engine/utils/dotProduct.ts

5 lines
170 B
TypeScript
Raw Normal View History

2023-08-25 18:48:17 -04:00
import type { Coord2D } from '../interfaces';
2023-07-19 23:38:24 -04:00
export const dotProduct = (vector1: Coord2D, vector2: Coord2D): number =>
vector1.x * vector2.x + vector1.y * vector2.y;