User:Wogga62/Sandbox

The Math object is always available. (Note that it is an object, not a constructor like Array or Date.) It has a number of Properties which return useful constants and also a number of Methods which provide access to mathematical functions such as Cosine and Square Root. All the trigonometric functions use angles expressed in radians; not degrees or grads. (One Radian is about 57.296°.)

There are one or two other Methods available in some recent software. See http://www.w3schools.com/jsref/jsref_obj_math.asp

Example of uses of the Math object

where = ( a*Math.sin(ang) + b*Math.cos(ang) > Math.sqrt(r2) ) ? "outside" : "inside"