| Math.PI Property | Flash 5; can be used when exporting Flash 4 movies |
| the ratio of a circle's circumference to its diameter, approximately 3.14159 |
The PI property represents the constant
, the ratio of the circumference of a circle to its
diameter.
Math.PI is famously used in calculating the area of a circle:
function circleArea (radius) {
// PI times the radius squared can also be written
// as Math.PI * Math.pow(radius, 2)
return Math.PI * (radius * radius);
}