IMCOT Function (OpenOffice Calc)
Calculate complex cotangent in Apache OpenOffice, with a zero-input pole, conjugate checks and a clear distinction from inverse tangent.
Verification status: Eight reference formulas and 5 diagnostic cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using generated native-ODF input and GUI hard recalculation. Saved formula identities and typed results were checked. How formula examples are checked
Quick answer: =IMCOT("1+i") returned 0.217621561854403-0.868014142895925i in the tested Apache OpenOffice 4.1.16 build.
Availability and version history
- Introduced: First release not established; the pinned 4.1.16 source confirms current-release presence.
- Supported in: Apache OpenOffice 4.1.16; this identifies a verified release, not a final supported version.
- Scope: Desktop Calc with its Analysis add-in, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight reference formulas and the listed diagnostics were recalculated from generated native-ODF input in 4.1.16 on Linux x86-64, Build 9816. Source and independent reference calculations were also checked.
What IMCOT returns
IMCOT returns complex cotangent, mathematically cos(z)/sin(z) where that quotient exists. It is a reciprocal trigonometric function, not an inverse function that recovers an angle from a tangent value. For z=a+bi, the independent component formula is cot(a+bi)=[sin(2a)−i sinh(2b)]/[cosh(2b)−cos(2a)]. Release entry.
Syntax and arguments
=IMCOT(ComplexNumber)
Exactly one complex-number argument is required. The add-in parses pure real forms and complex strings with lowercase i or j. Its strict parser rejects nonempty malformed text and empty strings. The trigonometric angles in the component formulas are in radians, not degrees.
Reproducible examples
The native column records the saved 4.1.16 results. The native strings are retained exactly. Independent component references are rounded to twelve decimal places, with rounded negative zero shown as zero. A tiny stored residual can therefore appear in the native string beside a reference component rounded to zero. Every successful result below is string-typed, including pure real-looking outputs.
| Formula | Native 4.1.16 string | Independent (real, imaginary) reference |
|---|---|---|
=IMCOT("1+i") |
0.217621561854403-0.868014142895925i |
(0.217621561854, -0.868014142896) |
=IMCOT("1-i") |
0.217621561854403+0.868014142895925i |
(0.217621561854, 0.868014142896) |
=IMCOT("-1+i") |
-0.217621561854403-0.868014142895925i |
(-0.217621561854, -0.868014142896) |
=IMCOT("-1-i") |
-0.217621561854403+0.868014142895925i |
(-0.217621561854, 0.868014142896) |
=IMCOT("1") |
0.642092615934331 |
(0.642092615934, 0) |
=IMCOT("i") |
-1.31303528549933i |
(0, -1.313035285499) |
=IMCOT("0.5+0.25i") |
1.43272107538799-0.887237040784096i |
(1.432721075388, -0.887237040784) |
=IMCOT("2+0.5i") |
-0.344514107017065-0.534978930835645i |
(-0.344514107017, -0.534978930836) |
Practical worksheet
For 1+i, the components are approximately 0.217621561854 and −0.868014142896. For i alone, cot(i)=−i coth(1), so the result is purely imaginary and negative. The input components use radians for the trigonometric interpretation.
For a worksheet, place a validated complex value in A2 and use =IMCOT(A2). This is an illustrative layout for the tested literal argument. Keeping real and imaginary measurements separately can make unit, sign and parsing mistakes easier to detect.
Advanced interpretation and checks
Cotangent is odd: cot(−z)=−cot(z). It respects complex conjugation. Away from zeros and poles, cot(z)tan(z)=1; this is a complex product and can be checked independently with the corresponding mathematical values.
The denominator in the component expression can be very small near a pole. A large result can therefore be mathematically expected, but input rounding can also dominate the final value. Do not use exact equality of rounded strings to test a reciprocal identity near a singularity.
Boundaries and troubleshooting
At zero, cotangent has a pole and the observed formula returns an error. Mathematical poles also occur at integer multiples of π on the real axis. A decimal approximation to π is not the exact pole, so a large finite output from an approximate argument should not be described as contradicting the zero-input error.
These additional formulas were recalculated through the same generated-ODF path. Error displays are retained as errors, even when an ODS numeric attribute stores zero.
| Formula | Observed result or error |
|---|---|
=IMCOT("0") |
Err:502 |
=IMCOT("abc") |
Err:502 |
=IMCOT("") |
Err:502 |
=IMCOT("1+j") |
0.217621561854403-0.868014142895925j |
=IMCOT("1";2) |
Err:504 |
Other spreadsheet implementations
The IMCOT guide for LibreOffice Calc documents that product’s own syntax and tested behavior. A shared function name does not guarantee the same argument conversion, text parsing, branch or precision rules.
Official evidence and checking scope
- Function-specific release entry
- Complex algorithm or collection helper
- Strict complex-string parser
- Finite-output string formatter
The saved ODS retained every tested formula identity. A deliberately stale SUM cache changed from 999999 to 3, and an uncached SUM returned 7 after hard recalculation. The application reported “Not all attributes could be read” on loading the generated input. All tested identities and input text survived, but preservation of every style attribute was not established. Native evidence covers the eight reference formulas and listed diagnostics only; it does not establish XLSX-import or manual-entry behavior. Other explanatory compositions are independent mathematical checks; other releases, locales and extreme-value behavior were not established by this run.