# Sun: Calculate the sunrise and sunset time of any place

 Info View files (5) Download .zip Reputation Support forum (1) Blog Links
 Ratings Unique User Downloads Download Rankings 67% Total: 3,513 All time: 950 This week: 190
 Version License Categories sun_rise_set 1.0.0 GNU General Publi... Algorithms, Geography, Physics
Description Author

This class contains methods for calculating the sunrise and sunset for any day, for any zenith (angle at which the sun is said to rise or set) and any place in the world given its latitude and longitude coordinates.

Please note that the algorithm used for the calculations are not mine. The algorithm was taken from http://williams.best.vwh.net/sunrise_sunset_algorithm.htm (without permission). There are many algorithms for calculating sunrise/sunset, but this was the simplest and explained in an easy to understand manner.

Innovation Award
 July 2004 Number 6Prize: One downloadable copy of PHPEd Knowing the sunrise and sunset time maybe important information for applications that depend on whether it is day or night. The sunset or sunrise time information may useful for something like giving the appropriate salute to an user given the current time of the day, or other more complex situations that depend on knowing whether it is day or night where an user lives. The calculation of the sunrise and sunset is not trivial. It depends on the geographic coordinates of the place in the world being considered, the day of the year and the position criteria that determines exactly when it is considered to start the sunrise or sunset. This class provides a solution that simplifies that problem by making the correct calculations considered all the important factors. Manuel Lemos
Name: Classes: Nesa Simon David `` 1 package by Nesa Simon David United Arab Emirates 44 909 2 in United Arab Emirates 619 1 in United Arab Emirates
Innovation award

Nominee: 1x

 Files
File Role Description
email1.txt Doc. an email correspondence, which may help to understand the sun class better.. :)
math.php Aux. contains math functions to calculate sin/cos/tan etc of angles given in degrees
sun.php Class sun class definition
sun_calendar.html Output sample output of sun_calendar.php
sun_calendar.php Example displays sunrise/sunset times of all days in a month

For more information send a message to `info at phpclasses dot org`.