cos

fun cos(complex: Complex): Complex(source)

Computes the cosine of a complex number. The cosine of a complex number is calculated using the formula: cos(a + bi) = cos(a)cosh(b) - i*sin(a)sinh(b), where a and b are the real and imaginary parts of the complex number, respectively.

Return

A new instance of Complex representing the cosine of the given complex number.

Parameters

complex

The complex number for which the cosine is to be calculated.