Python includes two functions in the math package; radians converts degrees to radians, and degrees converts radians to degrees.
To match the output of your calculator you need:
>>> math.cos(math.radians(1))
0.9998476951563913
Note that all of the trig functions convert between an angle and the ratio of two sides of a triangle. cos, sin, and tan take an angle in radians as input and return the ratio; acos, asin, and atan take a ratio as input and return an angle in radians. You only convert the angles, never the ratios.
I also like to define my own functions that take and return arguments in degrees rather than radians. I am sure there some capitalization purest who don't like my names, but I just use a capital first letter for my custom functions. The definitions and testing code are below.
Python convert radians to degrees or degrees to radians:
What are Radians and what problem does it solve?:
Radians and degrees are two separate units of measure that help people express and communicate precise changes in direction. Wikipedia has some great intuition with their infographics on how one Radian is defined relative to degrees:
You can do degree/radian conversion without python libraries:
If you roll your own degree/radian converter, you have to write your own code to handle edge cases.
Mistakes here are easy to make, and will hurt just like it hurt the developers of the 1999 mars orbiter, who sunk $125m dollars crashing it into Mars because of non intuitive edge case here.
Expressing multiple rotations with degrees and radians
Single rotation valid radian values are between 0 and 2*pi. Single rotation degree values are between 0 and 360. However if you want to express multiple rotations, valid radian and degree values are between 0 and infinity.
>>> import math
>>> math.radians(360) #one complete rotation
6.283185307179586
>>> math.radians(360+360) #two rotations
12.566370614359172
>>> math.degrees(12.566370614359172) #math.degrees and math.radians preserve the
720.0 #number of rotations
Collapsing multiple rotations:
You can collapse multiple degree/radian rotations into a single rotation by modding against the value of one rotation. For degrees you mod by 360, for radians you modulus by 2*pi.
>>> import math
>>> math.radians(720+90) #2 whole rotations plus 90 is 14.14 radians
14.137166941154069
>>> math.radians((720+90)%360) #14.1 radians brings you to
1.5707963267948966 #the end point as 1.57 radians.
>>> math.degrees((2*math.pi)+(math.pi/2)) #one rotation plus a quarter
450.0 #rotation is 450 degrees.
>>> math.degrees(((2*math.pi)+(math.pi/2))%(2*math.pi)) #one rotation plus a quarter
90.0 #rotation brings you to 90.
Fundamental education on Radians and Degrees
5 minute refresher using Trigonometry and expression of rotation to convert radians to degrees and back: https://youtu.be/ovLbCvq7FNA?t=31