# The JavaScript Math PI property

Posted on January 01, 2021

In JavaScript, the mathematical constant `PI` is stored in the Math object’s static property:

``````console.log(Math.PI);
// returns 3.141592653589793
``````

You can use the value of `Math.PI` to find the Diameter when you know the Circumference:

``````// Diameter = Circumference / π
let circumference = 20
let diameter = circumference / Math.PI
``````

You can find the Circumference by multiplying the PI with the Diameter:

``````// Circumference = π X Diameter
let diameter = 9
let circumference = Math.PI * diameter
``````

Finally, you can calculate the Radius of a circle if you know the Circumference:

``````// Radius = Circumference X 2π
let circumference = 17;
let radius = circumference * (2 * Math.PI)
``````

More on JavaScript:

### Grab the free JavaScript book today 👍

Learn the building blocks of JavaScript programming language like data types, functions, objects, arrays and classes.

Use the knowledge from the book to build a small but solid program.