www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons JavaScript Math Object Functions and Properties Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
Lesson 24
Lesson 25
Lesson 26
Lesson 27
Lesson 28
Lesson 29
Lesson 30
Lesson 31
Lesson 32
Lesson 33
Lesson 34
Lesson 35
Lesson 36
Lesson 37
Lesson 38
Lesson 39
Lesson 40
Lesson 41
Lesson 42
Lesson 43
Lesson 44
Lesson 45
Lesson 46
Lesson 47
Lesson 48
Lesson 49
The Math object is yet another built-in JavaScript object that includes a number of useful math constants and functions.

We do not need to create a Math object in JavaScript to work with. In JavaScript, it is available automatically.

The Math object's properties represent mathematical constants e.g. PI, E etc., and its methods are mathematical functions e.g. cos(), floor(), log() etc.

The following table lists the properties of the Math object:
Property Description
E The constant of E, the base of natural logarithms
LN2 The natural logarithm of 2
LN10 The natural logarithm of 10
LOG2E Base 2 logarithm of E
LOG10E Base 10 logarithm of E
PI Returns the value of PI
SQRT1_2 Square root of 1/2
SQRT2 Square root of 2

The following table lists the methods / functions of the Math object:
Methods Description
abs(x) Returns absolute value of x.
acos(x) Returns arc cosine of x in radians
asin(x) Returns arc sine of x in radians
atan(x) Returns arc tan of x in radians
atan2(y, x) Counterclockwise angle between x axis and point (x, y)
ceil(x) Returns the smallest integer greater than or equal to x
cos(x) Returns cosine of x, where x is in radians
exp(x) Returns ex
floor(x) Returns the largest integer less than or equal to x
log(x) Returns the natural logarithm (base E) of x
max(a, b) Returns the maximum of a and b
min(a, b) Returns the minimum of a and b
pow(x, y) Returns Xy
random() Returns a pseudorandom number between 0 and 1
round(x) Rounds x up or down to the nearest integer
sin(x) Returns the Sin of x, where x is in radians
sqrt(x) Returns the square root of x
tan(x) Returns the Tan of x, where x is in radians

Next >>> Lesson No. 36: JavaScript Boolean Object







Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.