JS Built-ins
← Math28 / 215
MathPIbeginner

Math.PI β€” area of circle

πŸ“– Usage Example
// Pi β€” ratio of circumference to diameter
Math.PI       // β†’ 3.1415926535...
2 * Math.PI   // β†’ 6.2831... (full circle in radians)

Use Math.PI when calculating circle circumferences, areas, or converting between degrees and radians.

Math.PI

The area of a circle is Ο€rΒ². For a unit circle (r=1), area = Ο€ β‰ˆ 3.14159.

Challenge: Use Math.PI to compute circle areas.

πŸ’‘ Hints (2)
  • β€’ Area = Ο€rΒ²
  • β€’ Math.PI * r * r is equivalent to Math.PI * Math.pow(r, 2).