# Pi: Most widely known mathematical constant

Pi is the most widely known mathematical constant that is commonly defined as the ratio of a circle’s circumference to its diameter approximately equal to 3.14159. It is also represented by the Greek letter “π”. Continue reading Pi: Most widely known mathematical constant

# math.pi() in JavaScript

We can use math.pi to get the constant value of PI. The Math.PI property represents the ratio of the circumference of a circle to its diameter and the value of the PI is approximately 3.14159.

Because PI is a static property of Math, you always use it as Math.PI, rather than as a property of a Math object you created.

You can check the value of the Pi in JavaScript itself like as below example.

```<html>
<title> Value of PI </title>
<body>
<script language="JavaScript">
var result = Math.PI;
document.write( "The Approximate value of PI is: " + result );
</script>
</body>
</html>```

Output will be :
The Approximate value of PI is: 3.141592653589793

The following example is the simple implementation of the formula : A = PI * R* R, where R is the radius of the circle and A is the area of the circle.

```<html>
<title>Find the area and circumference of a circle</title>
<body>
<script language="JavaScript">
<!–
function CalculateArea(){
document.write("<P>The area of the circle is " + (r * r * Math.PI) + "</p>");
}
–>
</script>
<form name=form1>