Math.js (system script)

From Spheriki

Jump to: navigation, search

All Sphere functions that work with angles use the radian unit instead of degrees. The math.js system script converts degrees to radians and vice versa.


Contents

Usage

RequireSystemScript("math.js");


Variables and functions of math.js

  • DegressToRadians(degrees)
    • converts degrees to radians.
  • RadiansToDegrees(radians)
    • converts radians to degrees.


Example

This will display the system arrow rotated by 90 degrees (it'll point downwards):

RequireSystemScript("math.js");
var img = GetSystemArrow();
img.rotateBlit(0, 0, DegreesToRadians(90));
FlipScreen();
GetKey();


See also


External links

Personal tools