Some general useful functions in GS2

(Some of them are for compatibility with JS/PHP/etc others are just good)
PHP Code:
function rand() {
return new MRandomLCG().randFloat();
}
function tan(x) {
return sin(x)/cos(x);
}
function atan2(y,x) {
return x<>0?x>0?atan(y/x):atan(y/x)-radian(180):y>0?radian(90):radian(-90);
}
function atan(number) {
return arctan(number);
}
function floor(number) {
return int(number);
}
function ceil(number) {
return int(number) < number ? number + 1 : number;
}
function radian(degree) {
return (degree * 0.0174532925);
}
function degree(radian) {
return (radian * 57.2957795);
}
function square(n) {
return (n * n);
}
function norm(angle) {
return (angle - 6.283185 * floor((angle + pi) / 6.283185));
}
function tile(pixel) {
return (pixel * 16);
}
function pixel(tile) {
return (tile / 16);
}
Enjoy
