Skip to content

pi - Calculate pi

The pi command produces the mathematical constant pi to 15 decimal places.

Syntax

pi(): number

Example - Computing the circular area from a distance.

Consider the following document:

{
    "distance_m": 10
}

We may want to calculate the area around this distance, to better understand what points this distance could have covered. We can do this using pi and the formula for the area of a circle.

create area from (pi() * power(distance_m, 2))

This will create a new field area in the document.