1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hextris_ynh.git synced 2024-09-03 19:16:05 +02:00
hextris_ynh/sources/js/math.js

15 lines
348 B
JavaScript
Raw Normal View History

2014-08-18 18:37:19 +02:00
function rotatePoint(x, y, theta) {
var thetaRad = theta * (Math.PI / 180);
var rotX = Math.cos(thetaRad) * x - Math.sin(thetaRad) * y;
var rotY = Math.sin(thetaRad) * x + Math.cos(thetaRad) * y;
return {
x: rotX,
y: rotY
};
}
function randInt(min, max) {
return Math.floor((Math.random() * max) + min);
}