{"id":24310,"date":"2021-10-14T09:18:11","date_gmt":"2021-10-14T03:48:11","guid":{"rendered":"https:\/\/python-programs.com\/?p=24310"},"modified":"2021-11-05T21:06:05","modified_gmt":"2021-11-05T15:36:05","slug":"python-program-for-cos-function","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-cos-function\/","title":{"rendered":"Python Program for cos() Function"},"content":{"rendered":"

In the previous article, we have discussed Python Program for atan2() Function<\/a>
\ncos() Function in Python:<\/strong><\/p>\n

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

The Trigonometry Cosine function’s mathematical formula is<\/p>\n

cos(A)= adjacent side of A\/ Hypotenuse<\/p>\n

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

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

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

x:<\/strong> This is required. It is a number. A number for which the cosine must be calculated. If the value is not a number, a TypeError is returned.<\/p>\n

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

Returns a float value ranging from -1 to 1 that represents the cosine of an angle.<\/p>\n