Calculate with Math.PI : Math « Development « JavaScript DHTML






Calculate with Math.PI

  

<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
var inpRadius;
inpRadius = 12;
alert(Math.PI * ((inpRadius)*(inpRadius)));
</script>
</head>
<body>

</body>
</html>

   
    
  








Related examples in the same category

1.Demo all math methods
2. Counting Rabbits (Calculating the Fibonacci Series Using a Recursive Function)
3.Math Round: round a number to the nearest whole number
4.Max number: get max number from two inputs
5.Min number: get the min number from two inputs
6.Using the Math Object
7.Math.max(inp1, inp2, inp3)
8.Math.min(inp1, inp2, inp3)
9.Math.random()
10.Math.round(rndNum)
11.Parenthesis for math statement
12.Using the const Keyword (Firefox only)
13.Math Object Property Summaries