## How to use the IMCOT function

The IMCOT function calculates the cotangent of a complex number in x + yi or x + yj text format.

The letter j is used in electrical engineering to distinguish between the imaginary value and the electric current.

**What are complex numbers?**

**What is a cotangent?**

The trigonometric cotangent is a function that relates an angle of a right-angled triangle to the ratio of adjacent side and the opposite side. It is also the inverse of the tangent, cot(Î¸) = 1/tan(Î¸).

**What is the difference between cotangent and complex cotangent?**

The difference between cotangent and cotangent for complex numbers is that the former is defined for real numbers, while the latter is defined for complex numbers.

The cotangent of a real number x is defined as cot(x) = i(e^{iÎ¸} + e^{-iÎ¸})/(e^{iÎ¸} - e^{-iÎ¸})

Natural number e is the base of the natural logarithm.

The complex cotangent of a complex number z = x + yi is defined as cot(x + yi) = (cosh(x)*cosh(y) - isin(x)*sinh(y)) / (sin(x)*cosh(y) + icos(x)*sinh(y))

Complex numbers has i as the imaginary unit.

### Table of Contents

## 1. IMCOT Function Syntax

IMCOT(*inumber*)

## 2. IMCOT Function Arguments

inumber |
Required. A complex number in x+yi or x+yj text format. |

## 3. IMCOT function example

The image above shows a formula in cell B28 that calculates the cotangent of a complex number specified in cell B25.

Cell C28 calculates the real number from the complex number in cell B28. Cell D28 extracts the imaginary number from the complex number specified in cell B28.

The real and imaginary numbers separated in a cell each allow us to graph the complex number on the complex plane.

Formula in cell B28:

The chart above shows the complex plane, the y-axis is the imaginary axis and the x-axis is the real axis.

Complex number 2+i is the light blue line in the first quadrant. The cotangent of 2+i is the green line located in the third quadrant.

### 3.1 Explaining formula

#### Step 1 - Populate arguments

IMCOT(*inumber*)

becomes

IMCOT(B25)

#### Step 2 - Evaluate the IMCOT function

IMCOT(C3)

becomes

IMCOT("2+i")

and returns

-0.171383612909185-0.821329797493852i

## 4. How is the IMCOT function calculated in detail?

The cotangent of a complex number is calculated like this:

cot(x + yi) = (cos(x)*cosh(y) - isin(x)*sinh(y)) / (sin(x)*cosh(y) + icos(x)*sinh(y))

For example, C=2+i

cot(2+i) = (cos(2)*cosh(1) - isin(2)*sinh(1)) / (sin(2)*cosh(1) + icos(2)*sinh(1))

becomes

cot(2+i) = (-0.416146836547142*1.54308063481524 - i0.909297426825682*1.1752011936438) / (0.909297426825682*1.54308063481524 + i-0.416146836547142*1.1752011936438)

becomes

cot(2+i) = (-0.64214812471552Â - i1.06860742138278) / (1.40311925062204 + i-0.489056259041294)

equals

-0.171383612909184-0.821329797493853i

## 5. IMCOT function not working - #NUM error

The IMCOT function returns a #NUM error if the provided argument is not a valid complex number.

### Useful links

IMCOT function - Microsoft

Cotangent of Complex Number

How to find cotangent of complex numbers

### Functions in 'Engineering' category

The IMCOT function function is one of many functions in the 'Engineering' category.

## How to comment

How to add a formula to your comment<code>Insert your formula here.</code>

Convert less than and larger than signsUse html character entities instead of less than and larger than signs.

< becomes < and > becomes >

How to add VBA code to your comment[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

How to add a picture to your comment:Upload picture to postimage.org or imgur

Paste image link to your comment.

Contact OscarYou can contact me through this contact form