PI Function (OpenOffice Calc)
The PI function in OpenOffice Calc returns the mathematical constant π (pi). Learn syntax, usage in geometry, trigonometry, and advanced formulas.
Verification status: Consult the documentation, examples and any stated test scope below. How formula examples are checked
Availability and version history
- Introduced: Documented by Apache OpenOffice 4.1.16; original introduction not established.
- Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
The PI function in OpenOffice Calc returns the mathematical constant π (approximately 3.14159265358979). PI is essential for geometry, trigonometry, engineering, physics, and probability calculations.
What the PI Function Does
- Returns the constant π
- Useful for geometry, trigonometry, and scientific formulas
- Works across sheets
- Provides a finite floating-point approximation
PI is ideal whenever a formula involves circles, angles, or periodic functions.
Syntax
PI()
Arguments:
- None — PI takes no parameters.
3.14159265358979
Basic Examples
Return the value of π
=PI()
Multiply π by a number
=2 * PI()
Convert degrees to radians
=Degrees * PI() / 180
Convert radians to degrees
=Radians * 180 / PI()
Geometry Examples
Circumference of a circle
=2 * PI() * Radius
Area of a circle
=PI() * Radius^2
Volume of a cylinder
=PI() * Radius^2 * Height
Surface area of a sphere
=4 * PI() * Radius^2
Volume of a sphere
=4/3 * PI() * Radius^3
Trigonometry Examples
Sine of 90 degrees
=SIN(90 * PI() / 180)
Cosine of π radians
=COS(PI())
Convert angle to radians inside trig functions
=SIN(A1 * PI() / 180)
Periodic wave function
=SIN(2 * PI() * Frequency * Time)
Advanced Examples
Gaussian (normal) distribution constant
=1 / (SQRT(2 * PI()) * sd)
Fourier series component
=SIN(2 * PI() * n * x)
Circle sector area
=0.5 * Radius^2 * AngleRadians
Arc length
=Radius * AngleRadians
PI across sheets
=PI()
(PI is constant, but can be used anywhere.)
Polar to Cartesian conversion
X:
=Radius * COS(ThetaRadians)
Y:
=Radius * SIN(ThetaRadians)
Cartesian to polar angle
=ATAN2(X; Y)
(Uses radians; PI helps convert to degrees.)
Common Errors and Fixes
PI takes no arguments. Supplying arguments is a signature error, not a request to ignore their contents. The callback pushes its fixed F_PI constant. The displayed decimal is a finite approximation to an irrational number, not an exact terminating decimal representation. Multiplying that constant by enormous dimensions can still overflow downstream arithmetic; the zero-argument constant itself has no input-domain problem.
An error in another operand of a PI-based expression still propagates through that expression. PI does not inspect, validate or discard those other operands. Check the dimensions, units, number types and angle convention in the surrounding formula.
Formula parsing errors are separate from mathematical domain errors. Check the function spelling, parentheses and the semicolon separator used in these examples. Number formatting affects display; the separate Calc precision-as-shown setting can also affect numeric reads, so the reference calculations assume ordinary stored-value precision. Dates and times are stored numeric values, but that does not make applying this mathematical operation physically meaningful to every date serial.
Best Practices
- Always convert degrees to radians using
* PI() / 180 - Use PI for all geometry and trigonometry formulas
- Use named ranges for radius, angle, and frequency for clarity
- Keep parentheses clean in multi‑step formulas
- Use PI with POWER for circle and sphere formulas
Reproducible numeric controls
| Formula | Independent reference result |
|---|---|
=ROUND(PI();10) |
3.1415926536 |
=ROUND(2*PI();10) |
6.2831853072 |
=ROUND(PI()*3^2;6) |
28.274334 |
=ROUND(2*PI()*3;6) |
18.849556 |
=ROUND(180*PI()/180;10) |
3.1415926536 |
=ROUND(COS(PI());10) |
-1 |
These are independent mathematical/source controls, not new native application or GUI observations. ERROR denotes an invalid or non-finite source path without inventing an observed localized message. Decimal expectations use the shown rounding precision; full stored results should be retained for subsequent arithmetic.
Complete worksheet and changed-input checks
Enter radii 1,2,3 in A2:A4. In B2 enter =2*PI()*A2 for circumference and in C2 enter =PI()*A2^2 for area; fill both down. Rounded to six decimals, circumferences are 6.283185,12.566371,18.849556 and areas are 3.141593,12.566371,28.274334. Use consistent length units and squared units for the two result columns.
Doubling radius from 1 to 2 doubles circumference but quadruples area. This changed-input check verifies linear versus quadratic dependence, including whether the area formula has the required square. It cannot by itself detect consistently using diameter as radius; the known-radius absolute outputs above provide that separate check.
Advanced validation and model boundaries
Check angle conventions. 90*PI()/180 is PI()/2 radians, approximately 1.5707963268; its sine is mathematically 1. In the other direction, PI()*180/PI() is 180 degrees. A degree value passed directly to a radian-based trigonometric function is a different angle.
Correct the coordinate order. OpenOffice ATAN2 takes x_coordinate first and y_coordinate second. For X=3,Y=4, =ATAN2(3;4) is approximately 0.9272952180 radians, or 53.1301023542 degrees. Reversing the arguments gives a different angle. The retained polar-conversion example has been corrected to this product-specific argument order.
Avoid replacing pi by a rounded literal too early. For radius 1000, area with 3.14 is 3140000, while the mathematical PI-based area is approximately 3141592.653589793. The discrepancy is about 1592.653589793 square units. Display rounding and rounding an intermediate constant are not the same operation.
Documentation and verification scope
The original useful examples, named-variable illustrations, shortcodes and design are retained; variables such as Radius, Rate, sd or Time must be defined as cells/names with the required units before those templates are executable. The earlier cross-sheet and Ctrl+Shift+Enter examples describe formula patterns, not a new GUI or array-entry test. Compatibility metadata does not certify identical coercion or boundary behavior in other products.
See the official PI reference, 4.1.16 mathematics help, scalar elementary functions, SIGN and logarithm callbacks, POWER implementation, numeric argument reading, and non-finite result handling. The first help/core snapshots retain October 13 retrieval dates; POWER retains October 14. Numeric-reader and result-handler sources were retrieved October 15. Original introduction and final functioning version remain unknown; the supported 4.1.16 evidence above is separate.