Johnno
Johnno

Reputation: 29

Questions about the function of Sine, Cosine, and Tangent in Python

I am starting to learn the math module in Python and I am trying to wrap my head around the trigonometry functions of sine, cosine, and tangent in Python.

I spent some time learning more about trigonometry and understand how the basic formulas work for right angled triangles:

Sine Function:
sin(θ) equals Opposite / Hypotenuse

Cosine Function:
cos(θ) equals Adjacent / Hypotenuse

Tangent Function:
tan(θ) equals Opposite / Adjacent

But I am not clear on how this applies in Python when it only accepts one value. I read that the value must be a radian.

So if x = 1 radian and math.sin(x)

Output equals 0.8414709848078965

So the sine of 1 radian is 0.8414709848078965

So my question is what did the sine function actually do to a radian of 1?

I am hoping the answer will also help me understand what is happening if I did cosine and tangent to radian 1.

Upvotes: 2

Views: 367

Answers (1)

Khushaal Nandwani
Khushaal Nandwani

Reputation: 27

python is using the taylor series of sin to find the value of sin 1. https://people.math.sc.edu/girardi/m142/handouts/10sTaylorPolySeries.pdf

Also, when you said how this is true when it accepts one value. I think you have a misconception. The sin, cosine, tangent functions take one argument i.e. theta and outputs a single value. Now, that value is equal to the base/hypotenuse (or whichever the trig function you have used) of the triangle of which angle you input in the trig function. SO you must not expect trig functions to give out two values.

Upvotes: 2

Related Questions