PI (JavaScript)
The value of pi.
Defined in
Math (JavaScript)Syntax
Math.PI
Usage
PI
is a constant.The value of pi is approximately 3.141592653589793.
Examples
This buttononclick
event
calculates the area and circumference of a circle given the radius.sessionScope.area =
sessionScope.radius * sessionScope.radius * Math.PI;
sessionScope.circum =
2 * sessionScope.radius * Math.PI