PI
Usage
-- Lingo syntax
PI
// JavaScript syntax
Math.PI
Description
Constant; returns the value of pi (p), the ratio of a circle’s circumference to its diameter, as a floating-point number. The value is rounded to the number of decimal places set by the floatPrecision property.
Example
This statement uses the PI constant as part of an equation for calculating the area of a circle:
-- Lingo syntax
vRadius = 3
vArea = PI*power(vRadius, 2)
trace(vArea) -- results in 28.2743
// JavaScript syntax
var vRadius = 3;
vArea = Math.PI*Math.pow(vRadius, 2);
trace(vArea); // results in 28.274333882308138
|