Method and accuracy

Every number on this site comes from formulas evaluated in your browser, not from a remote service. This page explains exactly which formulas, how accurate they are, and where they stop being appropriate.

Solar position

The sun's position follows Jean Meeus, Astronomical Algorithms, chapter 25: its mean longitude and anomaly and the eccentricity of the Earth's orbit give the true longitude, which is corrected for nutation and aberration, turned into right ascension and declination with the true obliquity of the ecliptic, and brought to your horizon with the apparent sidereal time. Delta T, the lag of the Earth's rotation behind uniform time, is applied, and so is the sun's small parallax for someone standing on the ground. Checked against the reference values in Meeus and in NREL's Solar Position Algorithm, the direction comes out within a few thousandths of a degree — about a hundredth of the sun's own disc. Azimuth is measured clockwise from true north.

Displayed altitudes include atmospheric refraction using the Saemundsson formula, which lifts an object on the horizon by about 34 arcminutes under standard conditions. Real refraction depends on temperature and pressure and can vary by a few arcminutes, which matters only within a couple of minutes of sunrise and sunset.

Rise, set and twilight

Event times are found from the hour angle at which the sun reaches a defined altitude, starting at the solar transit and repeated with the sun's declination and the sidereal time of the moment reached until the correction is under a second, so a time is as good as the position behind it. The thresholds are the conventional ones:

Event Sun altitude
Sunrise / sunset (upper limb, refracted) −0.833°
Sunrise end / sunset start −0.3°
Golden hour boundary +6°
Blue hour −6° to −4°
Civil twilight −6°
Nautical twilight −12°
Astronomical twilight −18°

Above the polar circles these events can be absent. The tools detect that case and report midnight sun or polar night rather than printing a misleading time.

The moon

The moon's position uses the main terms of Meeus's lunar tables (chapter 47) — the equation of the centre, evection, variation, the annual and parallactic equations and their companions down to a few thousandths of a degree — which put it within about two hundredths of a degree and its distance within a few tens of kilometres. It is then seen from where you stand, not from the Earth's centre: near the horizon that lowers the moon by up to a degree and moves moonrise by several minutes. Phase and illuminated fraction follow chapter 48; new and full moon fall within a couple of minutes of the published times. Moonrise and moonset are when the upper limb crosses the horizon, refraction included, found by scanning the day in ten-minute steps and closing in on each crossing to the second.

This is the right level of precision for photography, tides at a glance or planning a moonlit walk. It is not suitable for occultation timing, eclipse contact times or navigation.

Irradiation and the PV model

The solar energy tools model a full year of sun positions and convert each one into irradiance in two steps. First a clearness index Kt — the share of extraterrestrial radiation that reaches the ground — sets the global horizontal irradiance. Then the Erbs correlation splits it into a direct and a diffuse component, because a cloudy sky delivers a very different mix from a desert sky at the same total. Both components are projected onto the tilted plane, and ground reflection is added with an albedo of 0.2.

Typical yearly clearness values are about 0.42 for cloudy maritime climates, 0.50 for temperate ones, 0.58 for Mediterranean and up to 0.68 for deserts. Because a single value is applied across the year, the model reproduces annual totals and the shape of the seasonal curve well but cannot capture a local microclimate, a foggy valley or a monsoon.

Estimated production applies a performance ratio of 0.8, a common figure for a well-installed roof system covering inverter losses, temperature, wiring, soiling and mismatch. Use the results to compare orientations and to sanity-check a quote; use PVGIS or NREL data for the contract.

Shading and shadows

Shadow length is height divided by the tangent of the sun's altitude, and shadow direction is the sun azimuth plus 180°. A building is treated as a box: a rectangular footprint of the width and depth you enter, turned to the rotation you set, standing to its full height. In parallel sunlight such a box shades exactly its footprint swept away from the sun by the shadow length. A tree is a trunk with a crown: an ellipsoid as wide as the crown width, filling the top two thirds of the height, taken as solid. A spot is shaded by the crown when the line from it towards the sun passes through that ellipsoid, and by the trunk when it lies within the trunk's radius of the trunk's own shadow. Every five-minute step of the day is tested this way; the same tests colour the sun-hours map and draw the shadows on the map, so the three always agree. Terrain elevation is not modelled: the calculation assumes both points sit on the same level ground.

Time zones

The map shows times in your device's zone by default, including its daylight saving rules. You can switch to UTC, to true local solar time, or to the zone estimated from the pin's longitude. That last option is an estimate — political time zone borders do not follow meridians — so for travel planning check the actual zone of the country you are visiting.

Data and credits

  • Map tiles: the standard OpenStreetMap tiles, © OpenStreetMap contributors under the ODbL. No other base layer is used.
  • Place search and reverse geocoding: the OpenStreetMap Nominatim service.
  • Cities, their states and regions and their time zones: GeoNames (CC BY 4.0, adapted); clock changes, daylight saving time included, from the IANA time zone database.
  • Map engine: Leaflet, under the BSD 2-Clause License; its notice travels in the script itself.
  • Astronomy: Jean Meeus, Astronomical Algorithms, 2nd edition (1998) — the sun, the moon, nutation, sidereal time, the seasons and refraction, written for this site from the book.
  • Irradiance decomposition: Erbs et al., diffuse fraction correlation; Kasten–Young air mass.

Nothing on this site tracks you. See the privacy note for what the search box sends and what stays on your device.

Further reading

Learn more

All eighteen articles are in the Learn section.

Questions

Frequently asked questions

How accurate is the sun position?

Within a few thousandths of a degree for the sun's direction, checked against the reference values of Meeus and of NREL's Solar Position Algorithm — a hundredth of the width of the solar disc. Sunrise and sunset come out within seconds of the model, so what limits them is the air: real refraction at the horizon varies with temperature and pressure by enough to move sunrise by a minute or so, and more near the polar circles, where the sun meets the horizon at a shallow angle.

Does the site need an internet connection?

Only for the map tiles and the place search. All astronomy runs locally in JavaScript, so once the page is loaded the calculations keep working offline and no coordinates leave your device unless you type in the search box.

Can I use the figures for engineering or legal work?

Use them for planning and comparison. For a right to light assessment, a planning objection or a bankable PV yield report, verify with the appropriate authority: a national almanac for times, and PVGIS or NREL measured datasets for irradiation.