COS Function (Gnumeric)
Learn the COS function in Gnumeric: Returns the cosine of a number.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
COS calculates the cosine of an angle supplied in radians. Use it to project a length onto a horizontal axis, build a periodic model or check a triangle calculation. Gnumeric does not infer degrees from the input’s magnitude or a column label.
Syntax and units
=COS(x)
x is one required numeric angle in radians. A full turn is 2*PI(), a half turn is PI(), and a quarter turn is PI()/2 radians. The mathematical output for a finite real angle lies between -1 and 1. No optional argument changes the period or selects degrees.
If a cell contains degrees, convert with RADIANS. A degree symbol in a number format changes presentation only, not the stored number. Label the unit in the worksheet heading.
Retained starting example
=COS(0)
The expected result is 1. A zero angle points along the positive horizontal axis of the unit circle.
Build a degree-based table
Put 0, 60, 90 and 180 in A2:A5 under an Angle in degrees heading. Enter =COS(RADIANS(A2)) in B2 and fill down. The mathematical results are 1, 0.5, 0 and -1.
Floating-point evaluation at 90 degrees can leave a tiny residual near zero. Displaying six decimal places is reasonable for presentation, but use a tolerance if later logic must recognize a near-zero value. The formula =COS(PI()/3) gives approximately 0.5. By contrast, =COS(60) uses 60 radians and is not the same control.
Advanced application: length projection
A 10-unit segment makes a 60-degree angle with the positive horizontal axis. Put 10 in D2 and 60 in E2. The formula =D2*COS(RADIANS(E2)) gives a horizontal component of approximately 5 units.
The vertical component =D2*SIN(RADIANS(E2)) is approximately 8.660254038. Squaring and adding the components gives approximately 100, the square of the original length. This provides a geometric check independent of the cosine output alone.
For a periodic model, =3COS(2PI()A2/12) has amplitude 3 and period 12 when A2 measures elapsed units. At elapsed times 0, 3 and 6, the results are approximately 3, 0 and -3. The factor 2PI() converts a cycle fraction into radians.
Troubleshooting and precision
An unexpected sign can reflect a different quadrant. Inspect angle units and position before changing the formula. A text label such as “60 degrees” should be split into a numeric input and a separate unit label.
A tiny residual at a mathematical zero is ordinary floating-point behavior; exact equality to zero is not guaranteed. Extremely large angles can lose meaningful phase information because the stored number has finite precision. Keep model inputs sensibly scaled and check the accuracy your application requires.
These finite-angle controls do not establish a universal accuracy bound or certify every file-format conversion. Preserve the radian conversion when copying the formula into another workbook.
Availability and verification
Version coverage: Gnumeric 1.12.57 has the scoped checks below. The 1.12.62 evidence is a documentation/source check dated October 14, 2026.
- Introduced: Original introduction not established. The earliest demonstrated support in this guide is 1.12.57.
- Availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
- Scope: Desktop; the fn-math function module must be included and enabled.
- Checked: October 14, 2026. Documentation/source check; no new native test in Gnumeric 1.12.62.
The executable contract is also present in the official Gnumeric 1.12.57 fn-math source. The saved source was originally retrieved on October 17, 2026 and re-inspected for this guide. The last functioning release is not established; support in a named version is not a retirement claim.
On October 17, 2026, Gnumeric ssconvert 1.12.57 recalculated a synthetic workbook in the C.UTF-8 locale. Scoped controls: =COS(0) → 1; =COS(PI()/3) → 0.5000000000000001; =COS(RADIANS(60)) → 0.5000000000000001; =10*COS(RADIANS(60)) → 5.000000000000001. These are native calculation-engine results, not GUI tests or screenshots. Other tutorial layouts and displayed outputs are independent expectations unless covered by these exact formulas. Input/output files, preserved formulas, raw values and hashes were retained. The XLSX importer logged an unused workbookProtection-element warning; changed-input controls and recorded results were checked.