How to use the IMCOS function
What is the IMCOS function?
The IMCOS function calculates the cosine 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 is the cosine?
The cosine is a trigonometric function that relates to an angle θ in a right triangle to the ratio of the length of the side adjacent the angle and the length of the longest side (hypotenuse) of the triangle. A right triangle has one angle that measures 90° or π/2 radians which is approximately 1.5707963267949 radians.
What is the difference between sine and the complex sine?
The difference between cosine and complex cosine is that the former is defined for real numbers only, while the latter is defined for complex numbers as well. The cosine of a complex number has some similarities to the cosine of a real number, such as periodicity.
The cosine function is periodic considering the angle, meaning it repeats its values after a certain interval. The period of the cosine function is 2Ï€ or 360 degrees.
cosine z = (eiz + e-iz)/2
z - complex number
i - imaginary unit
Table of Contents
1. IMCOS Function Syntax
IMCOS(inumber)
2. IMCOS Function Arguments
inumber | Required. A complex number in x+yi or x+yj text format. |
3. IMCOS function example
The image above demonstrates a formula in cell B28 that calculates the cosine 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:
3.1 Explaining formula
Step 1 - Populate arguments
IMCOS(inumber)
becomes
IMCOS(B25)
Step 2 - Evaluate IMCOS function
IMCOS(B25)
becomes
IMCOS("2+2i")
and returns
-1.56562583531574-3.29789483631124i
4. How is the IMCOS function calculated in detail?
The cosine of a complex number is calculated like this:
C = x + yi
cos(C) = cos(x)*cosh(y) - sin(x)*sinh(y)i
For example, C=2+2i
cos(2+2i) = cos(2) cosh(2) - sin(2) sinh(2)i
becomes
cos(2+2i) = -0.416146836547142*3.76219569108363 + 0.909297426825682*3.62686040784702i
equals
cos(2+2i) = -1.56562583531574 - 3.29789483631124i
sin - calculates the sine of a number
cos - calculates the cosine of a number
cosh - calculates the hyperbolic cosine of a number
sinh - calculates the hyperbolic sine of a number
5. IMCOS function not working - #NUM error
The IMCOS function returns a #NUM error if the provided argument is not a valid complex number. The image above shows a worksheet with an invalid complex number specified in cell B25: 2+2
Excel needs an i or j in the complex number to work properly, correct the mistake and the IMCOS function will work again.
Useful links
IMCOS function - Microsoft
The Complex Cosine and Sine Functions - Mathonline
Cosine of Complex Number - Proofwiki
Functions in 'Engineering' category
The IMCOS function function is one of 42 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 signs
Use 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 Oscar
You can contact me through this contact form