2014-05-17 14:43:16 +00:00
|
|
|
function rotatePoint(x, y, theta) {
|
2014-05-18 18:15:13 +00:00
|
|
|
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;
|
2014-05-17 14:43:16 +00:00
|
|
|
|
2014-05-18 18:15:13 +00:00
|
|
|
return {
|
|
|
|
x: rotX,
|
|
|
|
y: rotY
|
|
|
|
};
|
2014-05-17 16:41:54 +00:00
|
|
|
}
|
|
|
|
|
2014-05-17 18:46:14 +00:00
|
|
|
function randInt(min, max) {
|
2014-05-18 18:15:13 +00:00
|
|
|
return Math.floor((Math.random() * max) + min);
|
2014-05-17 18:46:14 +00:00
|
|
|
}
|