Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
FogNetwork
GitHub Repository: FogNetwork/Tsunami
Path: blob/main/public/games/files/hextris/js/math.js
1036 views
1
function rotatePoint(x, y, theta) {
2
var thetaRad = theta * (Math.PI / 180);
3
var rotX = Math.cos(thetaRad) * x - Math.sin(thetaRad) * y;
4
var rotY = Math.sin(thetaRad) * x + Math.cos(thetaRad) * y;
5
6
return {
7
x: rotX,
8
y: rotY
9
};
10
}
11
12
function randInt(min, max) {
13
return Math.floor((Math.random() * max) + min);
14
}
15
16