2

I wanted to know what algorithm python's math.sin() built-in method and all other trig methods used. But I didn't find anything. I think it does it by assuming a circle of radius 1. But I still don't get how they specifically used the angle and the radius to calculate values for the trig functions. Does anyone know the specific code they used?

kgemp
  • 69
  • 4
  • 3
    I am sure it calls function `sin()` from the C math library. The latter is available as open-source code. You can look it up. Most likely it executes the FSIN instruction and lets the CPU handle the math. – DYZ Nov 19 '19 at 03:25
  • Is https://docs.python.org/3/library/math.html#trigonometric-functions of any help to you? – Jim Mischel Nov 19 '19 at 03:26
  • [See related answer](https://stackoverflow.com/a/13893832/1509695) – matanster Nov 09 '20 at 21:46

0 Answers0