Contact

IMCOT Function (Gnumeric)

Engineering Intermediate Gnumeric

Learn the IMCOT function in Gnumeric: Returns the cotangent of a complex number.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked

Evidence: Official documentation and exact Gnumeric 1.12.62 source were inspected. Numeric examples are independent calculations; native execution, locale behavior and workbook round-trips remain untested.

What does IMCOT do?

IMCOT evaluates complex cotangent for one complex-number argument. Calculate cot(z) as cos(z)/sin(z), including complex inputs; useful in complex trigonometric identities and some impedance transformations. It is not an ordinary real-only function, and its result may have both real and imaginary components. M1, S1.

For z = x + yi, the complex unit i satisfies i² = −1. The primary mathematical identity is cot(z) = cos(z)/sin(z) = 1/tan(z). Complex arithmetic is important even if the source data begin as ordinary real values.

Version-specific error distinction: The online 1.12 manual describes malformed complex inputs as #VALUE!. The official 1.12.62 source instead returns #NUM! when parsing a malformed complex string; other unsupported value types can still return #VALUE!. Any #VALUE! expectations below are the manual’s older documented rule, not verified 1.12.62 output. No native error test was performed.

Exact Gnumeric syntax

=IMCOT(z)
Parameter Position Type and meaning Required Default
z 1 A complex number, commonly represented by a valid string such as "1+2i" or produced with Gnumeric’s COMPLEX(x,y) Yes No optional argument or default

Use the spelling IMCOT. The documented function accepts one argument, not an arbitrary list or separate real,imag parameters. Create a value with =COMPLEX(1,2) first if your inputs are coefficients. COMPLEX(x,y,i) also documents a third optional suffix of "i" or "j", defaulting to "i". An inspected upstream helper accepts numeric values and complex strings, but no release-specific claims about coercion of booleans or formatting are made here. M1, S1.

The formulas below use commas and decimal points in the English-language notation used in the Gnumeric manual and examples. Your configured locale may use different argument separators or decimal conventions. That locale behavior has not been independently exercised, so consult the formula editor on the installed program before copying across locales.

Quick examples

=IMCOT("1+2i")
=IMCOT(COMPLEX(1,2))
=IMCOT("3+4i")

The two first expressions represent the same mathematical input. Expected numeric coefficients are listed below, but the exact number of digits, i/j suffix and error display are not claimed as tested Gnumeric outputs.

Reproducible worksheet exercise

In an empty sheet, enter each expression in column A and enter the corresponding IMCOT formula into column B. The first column deliberately uses COMPLEX(real,imag) to remove ambiguity from hand-typed complex-number syntax.

Cell Input (enter as formula in A) Formula in B Mathematical expected value (rounded to 8 decimals)
A2 =COMPLEX(0,0) =IMCOT(A2) undefined (mathematical pole; runtime error not tested)
A3 =COMPLEX(1,0) =IMCOT(A3) 0.64209262
A4 =COMPLEX(0,1) =IMCOT(A4) -1.31303529i
A5 =COMPLEX(1,2) =IMCOT(A5) 0.03279776-0.98432923i
A6 =COMPLEX(-0.5,0.25) =IMCOT(A6) -1.43272108-0.88723704i
A7 =COMPLEX(3,4) =IMCOT(A7) -0.00018759-1.00064439i
A8 =COMPLEX(0.5,-0.75) =IMCOT(A8) 0.46436046+1.17502945i

The first row is deliberately undefined mathematically because sin(0) = 0. The row is not an assertion about which Gnumeric error string appears. All finite expected coefficients above were calculated independently using the mathematical complex operations in Python 3’s cmath module on October 13, 2026. No native Gnumeric execution was conducted. Small differences in rounded displays are expected across numerical libraries; compare numerical real/imaginary components rather than literal complex text.

For a direct text-input check, enter "1+2i" as a quoted argument in the function formula. For a j-suffix check, construct the input with =COMPLEX(1,2,"j"). The inspected upstream code carries a parsed suffix into the complex output representation, but the exact 1.12.62 application display has not been tested. M1, S1.

Why the mathematics works

Read the quotient in the correct order

Gnumeric’s Complex manual explicitly defines IMCOT(z) = IMCOS(z) / IMSIN(z). Reversing the quotient computes the tangent, not cotangent. If A2 holds 1+2i, =IMCOT(A2) and =IMDIV(IMCOS(A2),IMSIN(A2)) should agree mathematically. A reciprocal version is =IMDIV(1,IMTAN(A2)); this also fails at zeros of tan(z).

Poles and complex arguments

The ordinary real cotangent is undefined at integer multiples of π, including 0. Those poles remain in the complex function. A value exactly at a mathematical pole is not an ordinary finite result; because floating-point π is approximate, a calculation near a pole might instead produce a huge finite value. A surprising large magnitude can therefore be a consequence of proximity to the pole, rather than a sign error in the formula.

For a purely imaginary input z = iy, cot(iy) = −i coth(y) (away from y = 0). The sign is negative; using +i would be a mistake. This identity can be checked against IMCOTH, which is a documented separate Gnumeric function, if a native review is undertaken.

Detailed application and advanced validation

Worked ratio check: Put =COMPLEX(1,2) in A2. In B2 enter =IMCOT(A2); in C2 enter =IMDIV(IMCOS(A2),IMSIN(A2)); in D2 enter =IMPRODUCT(B2,IMSIN(A2)). B2 and C2 should agree to an appropriate floating-point tolerance; D2 should agree with IMCOS(A2). These are documented formula routes and independently calculated expectations, not native Gnumeric test results.

Pole avoidance in a model: If a modeled phase angle is nominally 0, do not use cot(z) as if it were finite. Inspect the denominator with =IMABS(IMSIN(A2)) first. A very small denominator means a numerically sensitive quotient; any threshold should come from the precision and physical problem being modelled, not an arbitrary universal rule.

For a second, structurally different validation in the worksheet, use the following documented-function identity:

=IMPRODUCT(IMCOT(A2),IMSIN(A2))

Expected: agrees with IMCOS(A2) away from poles, within floating-point tolerance. This is an algebraic check rather than a second implementation of the same source code. Where the comparison uses division, it is valid only away from mathematical poles. If a worksheet displays a string, first extract real and imaginary components with IMREAL/IMAGINARY instead of attempting unsupported direct arithmetic on arbitrary complex text.

An alternative expression for the same result is:

=IMDIV(IMCOS(A2),IMSIN(A2))

This is intentionally presented as a mathematical cross-check for a future native reviewer, not a guaranteed drop-in replacement under every locale or Gnumeric build.

Errors, limits, and troubleshooting

Symptom / condition What is supported by the evidence Practical resolution
Invalid complex text, e.g. "not-complex" The published manual says #VALUE!, while inspected 1.12.62 source routes malformed complex strings toward #NUM!; the exact 1.12.62 runtime error is unverified. Enter a valid complex value like "1+2i", or use =COMPLEX(1,2); note the error actually observed during native QA.
Value type not accepted as a complex number The upstream parser distinguishes numeric, string, empty and unsupported types. It is not enough to assume another spreadsheet’s coercion rules. Check the cell’s type and use Gnumeric’s formula editor; do not assume that booleans behave like numeric inputs.
A blank input Official 1.12.62 source treats an empty value as zero, but output can depend on the function’s mathematical domain; no installed-version check was performed. Prefer explicit inputs to blanks for auditable worksheets; test blank handling in the actual installed version.
Output text seems not to equal expected text Complex formatting and rounding can change displayed trailing zeros and suffixes. Compare coefficients with IMREAL and IMAGINARY, using a justified numeric tolerance.
Unexpected huge, undefined or inaccurate values Mathematical singularity/overflow/cancellation may occur independently of software correctness. Check the input magnitude and mathematical domain; compare independent components. Avoid asserting a specific error code without a native test.
Formula not accepted after copying from another locale The tutorial shows English notation; locale-specific separators/decimal marks are not certified. Re-enter using the Gnumeric Function Browser or local formula settings.
Formula name seems missing The public catalogue documents registration, but a catalogue entry does not certify the particular installed version, distribution plug-ins or edition. Confirm installed Gnumeric version and the available function list; do not infer runtime support solely from the website.

Numerical precision and mathematical domain

Cotangent has poles at z = kÏ€ for integers k. At such values the mathematical ratio divides by zero. As Gnumeric’s published manual does not specify a pole-specific error token, the tutorial does not invent one. Separate malformed complex inputs (documented error discussion below) from mathematically undefined or numerically unstable inputs.

The official 1.12.62 code returns #NUM! if its internally computed complex result is invalid, while its published manual’s generic invalid-input note says #VALUE!. Do not interpret the catalogue’s Exhaustive test label as evidence for any specific worksheet example or on every platform.

Compatibility, version and platform boundaries

  • Software studied: Gnumeric desktop spreadsheet. The Gnumeric team announced version 1.12.62 in September 2026; source packages and platform-specific builds can differ. This manuscript is not certified against a locally installed copy on Linux, Windows or macOS. R1.

  • Upstream catalogue: IMCOT appears as Complete / Exhaustive in the currently accessible official catalogue. These labels summarize the upstream catalogue; they neither identify a specific package build nor replace native testing. C1.

  • Excel and other spreadsheets: The inspected source’s function-help block includes an Excel-compatibility statement, whereas the published web manual does not explicitly certify each of these functions as Excel compatible. Therefore, the source claim is labelled release-source documentation, not proven cross-product byte-for-byte equivalence. Excel/LibreOffice behavior was not used to deduce Gnumeric outputs. S1, M1.

  • Implementation evidence: The official manual confirms the function and syntax, the catalogue assigns a testing classification, and the inspected 1.12.62 source evaluates the expected complex operation. None alone means this exact workbook example ran in the 1.12.62 release.

Official references and evidence boundary

ID Checked Official evidence and supported claim
M1 2026-10-13 Gnumeric user manual, Complex category, section IMCOT: syntax IMCOT(z), one complex argument, named behavior, and manual’s invalid-input note.
C1 2026-10-13 Gnumeric official function catalogue: IMCOT listed as Complete / Exhaustive (classification of upstream support/test coverage, not this guide’s runtime test).
S1 Official Gnumeric 1.12.62 source Exact release complex callbacks and shared parser inspected after archive checksum verification; no native execution.
R1 2026-10-13 Gnumeric team’s 1.12.62 announcement (September 2026) notes a 1.12.62 release and improvements to complex-function Excel compatibility, without claiming these exact examples were executed.

Evidence limitations

No native Gnumeric execution, application screenshots, locale tests or workbook round-trip checks were performed. Source review and independent calculations do not replace application-level testing.