Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleEngine Compatibility

This library has not yet been ported to the New Pico Engine


The math library provides a number of useful math functions as well as special functions for plane-angle conversions, digests, trigonometry, and great-circle calculations. More are added as needed. 

...

power(<num1>,<num1>) - <num1> to the <num2>th power.

Code Block
language
languagejavascript
themeConfluencejavascript
 n = math:power(2,3);    //  n = 8

...

ceiling(<num>) - the smallest integer not less than <num>

Code Block
languagejavascript
themeConfluencelanguagejavascript
n = math:ceiling(2.78);    // n = 3

...

floor(<num>) - the largest integer not greater than <num>

Code Block
languagejavascript
themeConfluence
languagejavascript
n = math:floor(2.78);    // n = 2

...

round(<num> - convert <num> to the nearest integer.

Code Block
languagejavascript
themeConfluencelanguagejavascript
n = math:round(2.1);    // n = 2
m = math:round(2.7);    // n = 3

...


Plane Angle Conversions

deg2rad

...

Code Block
themeConfluence
langjavascript
// using the same co-ordinates as the great distance example
// find waypoint 3/4ths of the distance along the great circle
b = math:great_circle_waypoint(rlnga,r90 - rlata, rlngb,r90 - rlatb,.75);
lng = b[0];
lat = b[1];

 

...