CCOS Function

The CCOS function accepts a complex number and returns the cosine of that number. The cosine of a complex number z is calculated by using the identity for COS (a+b) on the number x+iy. Then the following identities are applied:

COS(iy) = COSH(y)

SIN(iy)=iSINH(y) 

These relationships are derived according to the definitions given under “Definitions Used in Complex Function Descriptions” earlier in this section. When the definitions of the hyperbolic sine and cosine are substituted in the equation, the algorithm becomes the following:

CCOS(x+iy) = (+ or -)1/2 SQRT(1-SIN**2(x)) (e**y + e**(-y)) - i/2*
SIN (x)*(e**y - e**(-y))  

The value of x is taken modulo 2pi before the sine function is applied. The negative sign is applied on the square root if the original x is in the second or third quadrants—that is, x is greater than or equal to pi/2 and less than or equal to 3pi/2.