Files
NixOS-configs/modules/wallpaper-engine/scripts/jsmodules/wevector.js
2025-02-07 17:04:43 -06: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;
}