Write a Python program that verifies the formula with the help of the Python Math library....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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: i) pick a random number between 0 and 180 (including both) representing an angle in degrees, say Dangle ii) convert the angle from degrees to radians, say Rangle iii) use the Math library to find and print the values of sin(Rangle) and cos(Rangle) and iv) 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 • Blank lines as shown in sample input are not required. However, you can get one with an empty print statement: print() Example output . The angle selected at random is 118 The angle t in radians is: 2.059488517353309 sin(t) 0.8829475928589271 cos (t)= -8.4694715627858905 2sin(t) cos(t)-sin(2t) is: 0.0 The angle selected at random is 3 The angle t in radians is: 0.05235987755982988 sin(t) 0.05233595624294383 cos(t) = 0.9986295347545738 2sin(t) cos(t)-sin(2t) is: 0.0 The angle selected at random is 32 The angle t in radians is: 0.5585053606381855 sin(t) 0.5299192642332049 cos (t) 0.848848096156426 2sin(t) cos(t)-sin(2t) is: -1.110223024625157-16 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: i) pick a random number between 0 and 180 (including both) representing an angle in degrees, say Dangle ii) convert the angle from degrees to radians, say Rangle iii) use the Math library to find and print the values of sin(Rangle) and cos(Rangle) and iv) 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 • Blank lines as shown in sample input are not required. However, you can get one with an empty print statement: print() Example output . The angle selected at random is 118 The angle t in radians is: 2.059488517353309 sin(t) 0.8829475928589271 cos (t)= -8.4694715627858905 2sin(t) cos(t)-sin(2t) is: 0.0 The angle selected at random is 3 The angle t in radians is: 0.05235987755982988 sin(t) 0.05233595624294383 cos(t) = 0.9986295347545738 2sin(t) cos(t)-sin(2t) is: 0.0 The angle selected at random is 32 The angle t in radians is: 0.5585053606381855 sin(t) 0.5299192642332049 cos (t) 0.848848096156426 2sin(t) cos(t)-sin(2t) is: -1.110223024625157-16
Expert Answer:
Answer rating: 100% (QA)
It seems like you want to write a Python program that converts angles from degrees to radians an... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Employers can impose deductions as a necessary part of the contract of employment for: Multiple Choice Cash shortages Inventory shortages Product damage Premiums for group insurance benefits Charges...
-
Principles of Community Engagement "Principles of Engagement, Second Edition" The fourth principle discusses "community empowerment". What does this term mean to you? Why is "empowerment" an...
-
The electric field component of an electromagnetic wave traveling in a vacuum is given by Ey = Eo sin (kx - wt), where E = 300 V/m and k=107m. What are the frequency of the oscillations (in Hz) and...
-
Prepare adjusting journal entries, as needed, considering the account balances excerpted from the unadjusted trial balance and the adjustment data. A. depreciation on buildings and equipment, $17,500...
-
Spring AB of constant 2kN/m is attached to two identical drums as shown. Knowing that the spring is unstretched when en θ = 0, determine (a) The range of values of the mass m of the block for...
-
Your friend (not an accounting major) thinks that prudence in the Conceptual Framework means being conservative. Do you agree? Explain.
-
Name the strongest benefit and the greatest weakness of agile development methodologies.
-
The weighted average cost of capital for a firm (assuming all three Modigliani and Miller assumptions apply) is 15 percent. What is the current cost of equity capital for the firm if its cost of debt...
-
A distinction is often made between management accounting and financial accounting. Management accounting focuses on internal reporting. It measures and reports financial and nonfinancial information...
-
Peter Cheese, current CEO of CIPD asserts, People professionals are a vital function in supporting businesses to adapt to rapidly changing circumstances. Explain two different models or theories to...
-
CHAPTER 3 Ex. 272 The following ledger accounts are used by the Heartland Race Track: Accounts Receivable Prepaid Printing Prepaid Rent Unearned Admissions Revenue Admissions Revenue Concessions...
-
What is being assessed sed with these following personality test? BIG 5 personality test Locus of control personality test TypeA personality test self-control and self-monitoring personality test...
-
Explain the psychoanalytic approach to personality Explain the humanistic theories Describe the trait theories of personality Describe the learning approaches to personality Explain how personality...
-
In this discussion, we will explore personality disorders. Personality disorders are characterized by traits that lead to maladaptive behaviors. View the following resources on personality disorders:...
-
Accounting and financial reporting for governmental entities, including fund accounting, special funds, and government wide financial statements. Retrieve a recent Comprehensive Annual Financial...
-
Find three scholarly articles that relate to a personality disorder of your choice (List is below) Summarize the findings per article. Paranoid Personality Disorder (Cluster A) Schizoid Personality...
-
Suppose you have a long position in the stock now. How would you hedge against price declines for a one-year period, using puts, calls, and combinations of options? Devise two different option...
-
In your readings, there were many examples given for nurturing close family relationships in this ever-evolving technological society we live in Based upon your readings and research describe three...
-
If you could make the mechanical equivalent of a stack that held golf clubs instead of numbers, why would it (conceptually) be a bad golf bag?
-
Consider the two C++ statements that follow: char grade = 65; char grade = 'A'; Are they equivalent?
-
Define a recursive function that takes an integer argument and returns the factorial of that argument. Recall that 3 factorial, written 3!, equals 3 2!, and so on, with 0! defined as 1. In general,...
-
If you stood atop a super-tall ladder three times as far from Earths center as at Earths surface, how would your weight compare with it present value?
-
How was Pioneer 10 able to escape the solar system with an initial speed less than escape speed?
-
With no gravity, a horizontally moving projectile follows a straight-line path. With gravity, how far below the straightline path does it fall compared with the distance of free fall?
Study smarter with the SolutionInn App