Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

JavaScript Tutorial
JavaScript Introduction
JavaScript How To
JavaScript Where To
JavaScript Variables
JavaScript If...Else Statement
JavaScript Switch Statement
JavaScript Operator
JavaScript Popup-boxes
JavaScript Function
JavaScript For-Loop
JavaScript While-loops
JavaScript Break Loops
JavaScript For..In Statement
JavaScript Event
JavaScript Try-Catch Statement
JavaScript Throw Statement
JavaScript Onerror
JavaScript Spacial Characters
JavaScript Guideline
JavaScript String
JavaScript Date Object
JavaScript Array
JavaScript Boolean Object
JavaScript Math Object
JavaScript HTML DOM Object
JavaScript Browser Detection
JavaScript Cookies
JavaScript Validation
JavaScript Animation
JavaScript Image Maps
JavaScript Timing Event
JavaScript Create Object
JavaScript Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


JavaScript Math Object
Previous Next

The Math object is a built-in Java Script object that includes math constants and functions. You do not need to create a Math object in Java Script; it exists automatically in any Java Script program. The Math object's properties represent mathematical constants, and its methods are mathematical functions.

Mathematical Values

In JavaScript there are eight mathematical values (constants) that can be accessed from the Math object. These are: E, PI, square root of 2, square root of 1/2, natural log of 2, natural log of 10, base-2 log of E, and base-10 log of E.


Properties

Properties 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 PI.
SQRT1_2 Square root of 1/2.
SQRT2 Square root of 2.

Methods

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. (round up).
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. (round down)
log(x) Returns the natural logarithm (base E) of x.
max(a, b) Returns the larger of a and b.
min(a, b) Returns the lesser 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. It rounds .5 up.
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.


Math(function) example

<script type="text/javascript">

document.write("Random: "+ Math.sin(180) + "<br/>")
document.write("PI: " + Math.cos(45) + "<br/>")
document.write("Sin: " + Math.tan(90) + "<br/>")

</script>


Output


Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords:JavaScript Math Object JavaScript: The Math Object JavaScript Math Object Reference


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.