Method Deck / geometry
Circle circumference and area
Computes a circle's circumference and area from its radius or diameter.
Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.
Try it
Inputs
- which_given (string, required) one of: radius, diameter : Whether value is a radius or a diameter.
- value (number, length units, required) min 0 : The radius or diameter, per which_given.
Outputs
- circumference (length units): Circle circumference.
- area (square length units): Circle area.
Steps
- If which_given is diameter, radius = value / 2; otherwise radius = value.
- circumference = 2 * pi * radius.
- area = pi * radius^2.
- Round both to 2 decimals.
Constants
- pi = 3.14159265358979 dimensionless (source: Circle circumference and area formulas)
Sources
- Circle circumference and area formulas (Wiley, 2026-09-30T19:48:00Z) - Standard formulas C=2*pi*r and A=pi*r^2.
Worked example and test vectors
| Name | Inputs | Answer |
| worked example | {"which_given":"radius","value":7} | circumference 43.98, area 153.94 |
| test vector: given diameter | {"which_given":"diameter","value":10} | circumference 31.42, area 78.54 |
Published card
- Address:
bc73720b7aa68d416956b102f8e908f9
- Made at:
2026-09-30T22:39:30.722Z
- Method sha256:
341bb69a251aa60fdb76388eb3ea7fe858f177105dd3317f68d41fc78df03efb