Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculate daylight hours Based on gegraphical coordinates

Tags:

algorithm

time

I want to calculate Daylight hours based on given Latitude and Longitude and DateTime
I mean calculate the time of sunrise and the time of sunset in a specefic Date and based on gegraphic coordinate.

like image 969
Navid Rahmani Avatar asked Jun 16 '11 13:06

Navid Rahmani


People also ask

How do you calculate daylight hours from latitude?

Multiply the tangents of latitude and declination angle. Find the cosecant inverse for the negative of the product. Multiply the resultant with -1 to get the hour angle for sunrise.

How do you calculate sunrise and sunset using latitude and longitude?

Sunrise/Sunset Calculations Then the UTC time of sunrise (or sunset) in minutes is: sunrise = 720 – 4*(longitude + ha) – eqtime where longitude and hour angle are in degrees and the equation of time is in minutes.

Does longitude affect daylight?

your location on Earth—as described by longitude and latitude‰is linked to the day and night cycle. You will build understanding of how the Earth's rotation and shape affect the 24 hour cycle of darkness and daylight.

How do we calculate length of the day?

Length of a day describes the moment from when the up- per limb of the sun disc appears above the horizon during sunrise, to the moment when the upper limb disappears below the horizon during the sunset.


1 Answers

Check this Latitude and Longitude and Daylight Hours

   D = daylength
   L = latitude
   J = day of the year

   P = asin[.39795*cos(.2163108 + 2*atan{.9671396*tan[.00860(J-186)]})]

                          _                                         _
                         / sin(0.8333*pi/180) + sin(L*pi/180)*sin(P) \
   D = 24 - (24/pi)*acos{  -----------------------------------------  }
                         \_          cos(L*pi/180)*cos(P)           _/
like image 85
Viktor Apoyan Avatar answered Oct 06 '22 18:10

Viktor Apoyan