yes
This commit is contained in:
15
modules/wallpaper-engine/scripts/jsmodules/wevector.js
Normal file
15
modules/wallpaper-engine/scripts/jsmodules/wevector.js
Normal file
@@ -0,0 +1,15 @@
|
||||
'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;
|
||||
}
|
||||
Reference in New Issue
Block a user