{"id":25407,"date":"2021-11-11T09:42:18","date_gmt":"2021-11-11T04:12:18","guid":{"rendered":"https:\/\/python-programs.com\/?p=25407"},"modified":"2021-11-11T09:42:18","modified_gmt":"2021-11-11T04:12:18","slug":"python-cmath-cos-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-cmath-cos-method-with-examples\/","title":{"rendered":"Python cmath.cos() Method with Examples"},"content":{"rendered":"

cmath.cos() Method in Python:<\/strong><\/p>\n

The cosine of a complex number is returned by the cmath.cos() method.<\/p>\n

Syntax:<\/strong><\/p>\n

cmath.cos(x)<\/pre>\n

Parameters<\/strong><\/p>\n

x:<\/strong> This is Required. It is a number that can be used to calculate the cosine of<\/p>\n

Return Value:<\/strong><\/p>\n

Returns a complex value that denotes the cosine of a complex number.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Complex Number = 3+4j<\/pre>\n

Output:<\/strong><\/p>\n

The given complex number's (3+4j) cosine value = \r\n(-27.034945603074224-3.851153334811777j)<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given realpart = 5\r\nGiven imaginary part = 2<\/pre>\n

Output:<\/strong><\/p>\n

The given complex number's (5+2j) cosine value = \r\n(1.0671926518731156+3.4778844858991573j)<\/pre>\n

Note:<\/strong> The above input format is for dynamic input.<\/p>\n

cmath.cos() Method with Examples in Python<\/h2>\n