Question: The angle selected at random is 98 The angle t in radians is: 1.710422666954443 sin(t) = 0.9902680687415704 tan(t) = -7.115369722384213 cos(t) = -0.1391731009600654 sin(t) -
The angle selected at random is 98 The angle t in radians is: 1.710422666954443 sin(t) = 0.9902680687415704 tan(t) = -7.115369722384213 cos(t) = -0.1391731009600654 sin(t) - tan(t) * cos(t) is: 1.110223024625157e-16 The angle selected at random is 50 The angle t in radians is: 0.8726646259971648 sin(t) = 0.766044443118978 tan(t) = 1.19175359259421 cos(t) = 0.6427876096865394 sin(t) - tan(t) * cos(t) is: -1.110223024625157e-16 The angle selected at random is 76 The angle t in radians is: 1.32645023151569 sin(t) = 0.9702957262759965 tan(t) = 4.010780933535842 cos(t) = 0.2419218955996679 sin(t) - tan(t) * cos(t) is: 0.0
Q-2 [40 pts] The trigonometry book says: sin(t) - tan(t)* cos(t) = 0 Write a Python program that verifies the formula with the help of the Python Math library. Note that the library trigonometric functions act on the angles in radians. Your program should perform the following steps 3 times: 1. Pick a random number between 0 and 180 representing an angle in degrees, say Dangle 2. Convert the angle from degrees to radians, say Rangle 3. Use the Math library to find and print the values of sin(Rangle) , cos(Rangle) , and tan(Rangle) , 4. Compute and print the value of the above expression. You can then visually verify if the result printed is 0 (or close to it). Notes * angle_in_radians = (angle_in_degrees * Pi)/180. You can also use the math.radians() function to convert degrees to radians. * Select a random integer between 0 and 180, possibly including 0 and 180. However, you will not lose points if you select a random float() or do not include boundaries (0 or 180) * Blank lines as shown in sample input are not required. However, you can get one with an empty print statement: print()Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
