Purpose
Return value
Syntax
=IMCOS(complex_num)
- complex_num - The complex number in the form "x+yi".
How to use
The Excel IMCOS function returns the cosine of a complex number. For instance, given “1 + 1i” as input, the function returns a complex number equal to the cosine of the input.
=IMCOS(COMPLEX(1,1)) // returns 0.833730025131149-0.988897705762865i
Given real number input, the function behaves like the cosine function. For instance, when π/2 + 0i is provided as input, the function returns -3.49148133884313E-15 (approximately zero). The cosine of π/2 is zero, but due to floating-point precision, it returns a very small number close to zero.
=IMCOS(COMPLEX(PI()/2,0)) // returns approximately 0
Explanation
Mathematically, the cosine of a complex number can be represented using a combination of the standard and hyperbolic trigonometric functions.
If B6 contains a complex number in the form "x+yi", this is equivalent to the following formula.
=COMPLEX(
COS(IMREAL(B6))*COSH(IMAGINARY(B6)),
-SIN(IMREAL(B6))*SINH(IMAGINARY(B6))
)
Alternatively, the cosine of a complex number can also be represented using the exponential function, where "z=x+yi."
If B6 contains a complex number in the form "x+yi", this is equivalent to the following formula.
=IMDIV(
IMSUM(
IMEXP(IMPRODUCT(COMPLEX(0,1), B6)),
IMEXP(IMPRODUCT(COMPLEX(0,-1), B6))
),
2
)