Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
titaniumnetwork-dev
GitHub Repository: titaniumnetwork-dev/Incognito-old
Path: blob/main/static/src/gs/public/hextris/js/math.js
1325 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