PHP/Javascript/HTML Sun Angle Tutorial

PHP/Javascript/HTML Sun Angle Tutorial

PHP/Javascript/HTML Sun Angle Tutorial

Here is a tutorial that calculates Noon Sun Angles on Earth via the entry of Latitude and Longitude. The calculation of noon sun angles uses the concept of Subsolar Point, which is explained in the quote from Wikipedia below.

The subsolar point on a planet is where its sun is perceived to be directly overhead (in zenith),[1] that is where the sun’s rays are hitting the planet exactly perpendicular to its surface. It can also mean the point closest to the sun on an object in space, even though the sun might not be visible.

For planets with an orientation and rotation similar to the Earth’s, the subsolar point will move westward, circling the globe once a day, but it will also move north and south between the tropics over the course of a year. The December solstice occurs when the subsolar point in the northern hemisphere is on the Tropic of Capricorn and the June solstice is at the instant when the subsolar point is on the Tropic of Cancer. The March equinoxes and September equinoxes occur when the subsolar point is on the equator.

The subsolar point is frequently used in celestial navigation and the coordinates of the subsolar point at various times throughout the year (often every hour) can be found in a nautical almanac.

The Javascript embellishments in this tutorial mainly revolve around:

The use of window.open can sometimes be blocked by web browsers depending on their settings and you can read a bit more about such issues here.

Useful tutorials that helped, and we give thanks to, were:

Here is a link to a live run. (The way it changed on 1/12/2013 to have a dropdown of placenames as extra functionality will be explained in a tutorial called PHP/Javascript/HTML Geographical Placename Integration Tutorial on 3/12/2013.)

Here is a link to some downloadable PHP programming source code which you may want to rename to sun_angle_now_at.php

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Tutorials and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>