/ Published in: JavaScript
Expand |
Embed | Plain Text
Math.abs(n) // Returns the absolute value of n Math.acos(n) // Returns (in radians) cos-1 of n Math.asin(n) // Returns (in radians) sin-1 of n Math.atan(n) // Returns (in radians) tan-1 of n Math.atan2(n,k) // Returns the angle (rads) from cartesian coordinates 0,0 to n,k Math.ceil(n) // Returns n rounded up to the nearest whole number Math.cos(n) // Returns cos n (where n is in radians) Math.exp(n) // Returns en Math.floor(n) // Returns n rounded down to the nearest whole number Math.log(n) // Returns ln(n) // Note, to find log10(n), use Math.log(n) / Math.log(10) Math.max(a,b,c,...) // Returns the largest number Math.min(a,b,c,...) Returns the smallest number Math.pow(n,k) // Returns n^k Math.random() // Returns a random number between 0 and 1 Math.round(n) // Returns n rounded up or down to the nearest whole number Math.sin(n) // Returns sin n (where n is in radians) Math.sqrt(n) // Returns the square root of n Math.tan(n) // Returns tan n (where n is in radians)
You need to login to post a comment.
