Python cmath.cos() Method

❮ cmath Methods


Example

Find the cosine of a complex number:

#import cmath for complex number operations
import cmath

#find the cosine of a complex number
print (cmath.cos(2 + 3j))
Try it Yourself »

Definition and Usage

The cmath.cos() method returns the cosine of a complex number.


Syntax

cmath.cos(x)

Parameter Values

Parameter Description
x Required. A number to find the cosine of

Technical Details

Return Value: A complex value, representing cosine of a complex number
Python Version: 1.5

❮ cmath Methods

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.