Files
2025-04-29 13:39:02 -05:00

16 lines
305 B
JavaScript

'use strict';
import * as WEMath from 'WEMath';
export function angleVector2(angle) {
angle = angle * WEMath.deg2rad;
return new Vec2(
Math.cos(angle),
Math.sin(angle)
);
}
export function vectorAngle2(direction) {
return Math.atan2(direction.y, direction.x) * WEMath.rad2deg;
}