Question: Ple Help me by Python Part 2: Minutes of Daylight Here's a significantly more complicated formula-determining the amount of sunlight in a day, given the

Ple Help me by Python Part 2: Minutes of Daylight Here's aPle Help me by Python

Part 2: Minutes of Daylight Here's a significantly more complicated formula-determining the amount of sunlight in a day, given the day of year and the latitude of your location. Write a program named Lastname_firstname_daylight.py that asks the user for two items: a latitude in degrees and a Julian day of the year from 1 to 365. The program will calculate the number of minutes of sunshine for the day, using the formula explained at the Ask Dr. Math website, and will print it, properly labeled. You will want a variable that holds the latitude converted to radians. However, Python's trigonometric functions require angles in radians, so you must use the math module's radians function. Calculate p = arcsin (0.39795 cos (0.2163108 + 2. arctan (0.9671396 tan (0.00860. (day - 186))))) Note: You may need to reduce the font size to see the formula in its entirety. Here is the formula in text format: p=arcsin(0.39795.cos(0.2163108+2.arctan(0.9671396-tan(0.00860-day-186))))) Calculate d = 24 7.63944 - arccos ( sin 6201 sin (0.01454)+sin (latitude). sin (p) cos (latitude).cos(p) The variable d holds the number of hours of daylight, so multiply that by 60 for your final result. Your results should be very close to those generated by the National Oceanic and Atmospheric Administration spreadsheetse, which use a far more complicated algorithm than the one given here. Download the "Day" spreadsheet. Here is an example of what the output of your program might look like. It does not have to be identical to this, but should convey the same information. Enter latitude in degrees: 37.338 Enter day of year (1-365): 1 There are about 577.896 minutes of daylight

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!