[Tutor] Trigonometric Functions in Python

April Morone linuxwebdeveloper at gmail.com
Sun May 24 20:09:32 EDT 2020


I signed up for the ITP100 Software Design (Python Programming) class for
this Summer. I have been working ahead through the book, but came across an
issue with understanding something within Chapter 4 of the book "Python for
Everybody: Exploring Data in Python 3" that is by the author Charles
Severance on page 45. Please explain for me how the following checks the
result of the conversion from degrees to radius to get  0.7071067811865476
to see if the result is correct:

math.sqrt(2) / 2.

of the following:

>>> degrees = 45
>>> radians = degrees / 360.0 * 2 * math.pi
>>> math.sin(radians)
0.7071067811865475

I never got to complete PreCalc w/Trig class (had to withdraw from it even
though I had a C in it for several reasons, so this doesn't fully make
sense to me, even though the formula itself to convert degrees to radians
does make sense. The way to check results however, does not make sense to
me.

How does the following check the result of the above conversion from
degrees to radius to see if the result is correct?

>>> math.sqrt(2) / 2.0


More information about the Tutor mailing list