This is being caused by the fact that you are using degrees
and the trigonometric functions expect radians as input:
sin(radians)
The description for sin
is:
sin(x)
Return the sine of x (measured in radians).
In Python, you can convert degrees to radians with the math.radians
function.
So if you do this with your input:
>>> math.sin(math.radians(35)) * 15 + 9
17.60364654526569
it gives the same result as your calculator.