Trigonometry: sin(x) getting negative value
<p>I am trying to solve a homework: I am required to write a program which will calculate the length of a ladder based on two inputs, that is the desired height to be reached and the angle created by leaning the ladder toward the wall.</p>

<p>I used the following formula to convert degrees to radians :</p>

<pre><code>radians = (math.pi / 180) * x # x is the given angle by the user.
</code></pre>

<p>I imported the math library as well to use its functions.</p>

<pre><code>def main():

    import math 

    print("this program calculates the length of a ladder after you give the height and the angle")

    h = eval(input("enter the height you want to reach using the ladder"))
    x = eval(input("enter the angle which will be created be leaning the ladder to the wall"))

    radians = ( math.pi / 180 ) * x

    length = h / math.sin(x)

    print("the length is:", length)


main()
</code></pre>

<p>What exactly am I doing wrong?<br>
I know the code is missing something and would appreciate it if someone could help me fill the gap.</p>

<p>You never used <code>radians</code> after you calculate it. </p>

<p>i.e. <code>length = h / math.sin(radians)</code></p>

python