Added shape drawing and more vector helper functions

This commit is contained in:
Mitchell McCaffrey
2020-04-27 21:39:21 +10:00
parent e08dc60f5f
commit 81f84d8a19
6 changed files with 278 additions and 62 deletions
+8
View File
@@ -34,3 +34,11 @@ export function snapPositionToGrid(position, gridSize) {
y: roundTo(position.y, gridSize.y),
};
}
export function toRadians(angle) {
return angle * (Math.PI / 180);
}
export function toDegrees(angle) {
return angle * (180 / Math.PI);
}