# Mathematical functions: Difference between revisions

## Functions of the JavaScript Object Math

The following functions are part of every JavaScript virtual machine:

• Math.abs;
• Math.acos;
• Math.asin;
• Math.atan;
• Math.ceil;
• Math.cos;
• Math.exp;
• Math.floor;
• Math.log;
• Math.max;
• Math.min;
• Math.random;
• Math.sin;
• Math.sqrt;
• Math.tan;

JSXGraph expands the set of available mathematical functions. To keep the JavaScript implementations clean, the new mathematical functions are part of the JSXGraph board. That means, initially a board has to be created, for example with the command

board = JXG.JSXGraph.initBoard('box', {originX: 250, originY: 250, unitX: 40, unitY: 40});


Then, the object board contains the following additional mathematical functions:

• board.angle(A, B, C): for Point objects A, B, C. (A: name string, id string or object pointer)
• board.pow(a, b): $\displaystyle{ a^b }$ for floating point value of b. Math.pow is defined for integer values of b', only.
• board.factorial(n): computes $\displaystyle{ n! = n\cdot(n-1)\cdot\ldots2\cdot 1 }$.