COS

The periodic function COS returns the trigonometric cosine of X.

Calling Sequence

Result = COS( X )

Arguments

X

The angle for which the cosine is desired, specified in radians. If X is double-precision floating or complex, the result is of the same type. All other types are converted to single-precision floating-point and yield floating-point results. When applied to complex numbers:

COS( x ) = COMPLEX(cos I cosh R , -sin R sinh ( -I ))

where R and I are the real and imaginary parts of x .

If X is an array, the result has the same structure, with each element containing the cosine of the corresponding element of X .

Example

Find the cosine of 0.5 radians and print the result by entering:

PRINT, COS(.5)

IDL prints:

0.877583

See Also

ACOS , COSH