Use Math.PI to do calculation : PI : Math JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Math » PI »

 

Use Math.PI to do calculation

















<html>
<head>
<title>Find the area and circumference of a circle</title>
<script type="text/javascript" language="javascript">
<!-- //
function FindArea(){
    var number = new Number(123);
    document.write("<P>You entered a radius of " + number + "</p>");
    document.write("<P>The area of the circle is " (number * number * Math.PI"</p>");
    document.write("<P>The circumference of the circle is " (* number * Math.PI"</p>");
}
// -->
</script>
</head>
<body onload="FindArea()">

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Math
» PI