Back to Articles

Data Sources and Calculations

This page documents, in technical detail, the calculations, algorithms and data sources that Planet Summary uses to compute the positions of the planets, their rise and set times, their altitude and azimuth, their apparent magnitude, their distance from Earth and the Sun, and the zodiacal sign in which each body appears.

It is intended to answer, in one place, every reasonable question about the methodology behind the other pages on this site. Where a value is shown on another page, the chain of computation that produced it can be traced back to the sections below.

The implementation lives in the site's astronomical library and is evaluated entirely in your browser. No external ephemeris service is queried at runtime; the positions you see are computed locally from the orbital elements and algorithms described here.

Scope and accuracy

The goal of Planet Summary is to present accurate, observationally useful positions for the major planets, not to reproduce a full numerical integration of the Solar System.

The method used is a mean-element Keplerian model: each planet is placed on its osculating ellipse and its position is propagated analytically from a fixed set of orbital elements with linear secular rates. This is the same class of model used for the "low-precision" series in the Astronomical Almanac and is accurate to a small fraction of a degree for the naked-eye planets over several centuries around the present epoch.

Typical agreement with high-precision ephemerides is on the order of a few arcminutes in ecliptic longitude for the inner planets and of the order of a tenth of a degree or less for the outer planets. This is comfortably within the tolerance needed to point a telescope, plan an observing session, or judge whether a planet is above the horizon. It is not sufficient for occultation prediction or spacecraft navigation, and the site does not claim to be.

Where greater precision is required, the cross-check sources listed at the end of this page provide full numerical ephemerides.

Time: Julian Day

All internal calculations are carried out in Julian Day (JD), the continuous count of days since 1 January 4713 BC, noon UT. Converting a civil date and time to JD is the first step of every computation.

The observer's local wall-clock time is first reduced to Universal Time by subtracting the supplied time-zone offset, then combined with the calendar date using the standard integer algorithm:

if month ≤ 2: year ← year − 1, month ← month + 12
A = floor(year / 100)
B = 2 − A + floor(A / 4)
JD = floor(365.25·(year + 4716)) + floor(30.6001·(month + 1)) + day + B − 1524.5 + UT/24

The 30.6001 factor and the B correction implement the Gregorian calendar reform, so dates on both sides of 15 October 1582 are handled correctly. The half-day offset (−1524.5) places the JD origin at noon UT as is conventional.

For real-time pages the current instant is obtained from the JavaScript Date object and converted with the simpler continuous relation:

JD = Date.getTime() / 86400000 + 2440587.5

Both paths produce the same quantity and are used interchangeably depending on whether the input is a form-supplied date or the live clock.

The Julian century

Secular variation in the orbital elements and in the obliquity of the ecliptic is expressed against Julian centuries from the standard epoch J2000.0 (JD 2451545.0, 2000 January 1 12:00 TT):

T = (JD − 2451545.0) / 36525

Every element that drifts with time is written as a base value at J2000 plus a rate multiplied by T. This linear extrapolation is the dominant source of the small residual error mentioned above, because the true secular variation contains higher-order terms that the model omits by design.

Orbital elements and their source

Each planet is described by six Keplerian elements plus six secular rates. The values used by Planet Summary are the J2000 mean elements and centennial rates published by the Jet Propulsion Laboratory as part of the approximate Keplerian element tables that accompany the JPL planetary ephemerides.

For each body the stored quantities are:

  • semi-major axis a (AU) and its rate
  • eccentricity e and its rate
  • inclination I (degrees) to the J2000 ecliptic and its rate
  • mean longitude L (degrees) and its rate
  • longitude of perihelion ϖ (degrees) and its rate
  • longitude of the ascending node Ω (degrees) and its rate

From these the argument of perihelion is recovered as ω = ϖ − Ω and the mean anomaly as M = L − ϖ, both normalised to the range used by the solver.

The elements are stored to the full precision given in the source table (typically 8–10 significant figures for the base values) so that rounding does not become the dominant error term. The same table is used for Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto.

Why Earth is treated as a planet

Because the observer is on Earth, the geocentric position of every other body is obtained by subtracting Earth's heliocentric position from the body's heliocentric position. Earth is therefore propagated with exactly the same machinery as the other planets, using its own row of elements. The Sun's geocentric position is simply the negation of Earth's heliocentric position.

Solving Kepler's equation

Given the mean anomaly M and eccentricity e, the eccentric anomalyE is found by solving Kepler's transcendental equation:

E − e·sin(E) = M

This has no closed-form solution and is solved iteratively by Newton's method, seeded withE₀ = M:

E_(n+1) = E_n − (E_n − e·sin(E_n) − M) / (1 − e·cos(E_n))

Eight iterations are performed. For the planetary eccentricities in the Solar System (all below 0.21 except Mercury and Pluto) this is far more than required for double-precision convergence; the iteration typically reaches machine-limited accuracy in three to five steps. The fixed iteration count is chosen for simplicity and predictability rather than because the extra steps are needed.

Heliocentric position in the orbital plane

With E in hand, the body's position in its own orbital plane, measured from the focus occupied by the Sun, is:

x′ = a·(cos E − e)
y′ = a·√(1 − e²)·sin E

These are the standard perifocal coordinates. The factor √(1 − e²) accounts for the fact that the orbit is an ellipse rather than a circle.

Rotation to the ecliptic frame

The perifocal coordinates are rotated into the J2000 heliocentric ecliptic frame by three rotations: by the argument of perihelion ω, by the inclination I, and by the longitude of the ascending node Ω. The combined transform, written out in full, is:

x = (cos ω·cos Ω − sin ω·sin Ω·cos I)·x′ + (−sin ω·cos Ω − cos ω·sin Ω·cos I)·y′
y = (cos ω·sin Ω + sin ω·cos Ω·cos I)·x′ + (−sin ω·sin Ω + cos ω·cos Ω·cos I)·y′
z = (sin ω·sin I)·x′ + (cos ω·sin I)·y′

The result (x, y, z) is the body's heliocentric position in astronomical units, referred to the J2000 mean ecliptic and equinox. This is the quantity that is subtracted from Earth's heliocentric position to give a geocentric vector.

Geocentric position

For a planet P the geocentric ecliptic vector is:

r_geo = r_helio(P) − r_helio(Earth)

For the Sun it is the negation of Earth's heliocentric vector. The geocentric distance shown on the site is the Euclidean norm of this vector:

Δ = √(x² + y² + z²)

The heliocentric distance r shown alongside it is the norm of the body's own heliocentric vector, not the geocentric one.

Ecliptic longitude and the zodiacal sign

The geocentric ecliptic longitude is the angle of the geocentric vector measured eastward from the J2000 equinox:

λ = atan2(y, x) (normalised to 0°–360°)

The zodiacal sign reported on the summary and chart pages is obtained by dividing this longitude into twelve equal 30° sectors, beginning at 0° Aries. The degree and minute within the sign are the integer and fractional parts of λ mod 30°. This is a straightforward ecliptic-longitude placement; it is not a statement about astrology, and no house system or interpretive content depends on it beyond the equal-sign division shown.

The obliquity of the ecliptic

To convert ecliptic coordinates to the equatorial coordinates (right ascension and declination) used by the horizon transform, the ecliptic is rotated about the x-axis by the obliquityε. The mean obliquity is taken as a linear function of the Julian century:

ε = 23.439291° − 0.0130042°·T

This is the IAU 1976 mean obliquity truncated to its linear term. The omitted quadratic and cubic terms contribute less than an arcsecond over a century and are neglected here.

Equatorial coordinates: right ascension and declination

Applying the obliquity rotation to the geocentric ecliptic vector gives equatorial coordinates:

y_eq = y·cos ε − z·sin ε
z_eq = y·sin ε + z·cos ε
α = atan2(y_eq, x) (normalised to 0°–360°)
δ = atan2(z_eq, √(x² + y_eq²))

Right ascension α is returned in degrees (not hours) so that it can be used directly in the same trigonometry as the other angles; one hour of right ascension equals 15°. Declination δ is positive north of the celestial equator and negative south of it.

Sidereal time and the local sidereal time

The horizon transform requires the local sidereal time, which tells the observer which right ascension is currently on their meridian. The Greenwich mean sidereal time is computed from the formula:

GMST = 280.46061837° + 360.98564736629°·(JD − 2451545.0) + 0.000387933°·T²

The large coefficient 360.98564736629° per day encodes the fact that Earth rotates slightly more than 360° relative to the stars in one solar day — the difference between the sidereal and solar day. The quadratic term corrects for the long-term deceleration of Earth's rotation as a coordinate quantity.

The local sidereal time adds the observer's east-longitude:

LST = GMST + λ_observer

The hour angle of a body is then the difference between the local sidereal time and the body's right ascension:

H = LST − α

The equation of the equinoxes (nutation in right ascension) is not applied, so the sidereal time used here is the mean sidereal time. The resulting error is well under an arcsecond and is irrelevant for the observational purposes of the site.

The horizontal coordinate transform

Given the hour angle H, the observer's geodetic latitude φ, and the declination δ, the altitude h and azimuth A are obtained from the standard spherical-astronomy relations:

sin h = sin φ·sin δ + cos φ·cos δ·cos H
A = atan2(sin H, cos H·sin φ − tan δ·cos φ) + 180°

Altitude is clamped to the valid range of asin before inversion. Azimuth is normalised to 0°–360° and measured clockwise from north, which is the convention used throughout the site and in the compass-bearing labels (N, NNE, NE, …). The 180° offset in the azimuth formula converts the astronomer's convention (measured from the south, increasing westward) into the navigator's convention (measured from the north, increasing eastward) that observers expect when using a compass.

The latitude and longitude used here are geodetic, taken from the city the visitor selects or searches for. No correction for geocentric latitude is applied; the difference is at most a tenth of a degree and is neglected.

Rise, set and transit

Rise and set times are found by detecting when the body's altitude crosses the horizon. Rather than solve the quadratic rise-set formula analytically — which is unreliable for the Moon and for high-latitude observers where the small-number behaviour of the tangent becomes ill-conditioned — Planet Summary samples the altitude over a wide window and locates the sign changes directly.

The procedure is:

  • Beginning 24 hours before the query instant, recompute the body's equatorial position and altitude every 2 minutes for a total span of 72 hours. Recomputing the position at every sample, rather than holding it fixed, accounts for the planet's proper motion and is essential for the Moon and for accurate rise/set azimuths.
  • A horizon threshold of h₀ = −0.57° is used for the planets. This is the standard geometric horizon corrected for the body's apparent semi-diameter and a nominal atmospheric refraction of 34 arcminutes at the horizon, so that "rise" means the moment the upper limb first becomes visible, not the moment the geometric centre crosses the astronomical horizon.
  • Each upward crossing of h₀ is a rise; each downward crossing is a set. The crossing time is refined by linear interpolation between the two bracketing samples, which is accurate to a small fraction of the 2-minute step.
  • The maximum altitude in the window is recorded as the transit (meridian passage) altitude.
  • If the body never drops below h₀ it is reported as circumpolar; if it never rises above h₀ it is reported as never-rising. Both outcomes depend on the observer's latitude and the body's declination.

The rise/set pair returned to the page is selected to match the body's current visibility: if the body is above the horizon now, the rise is the most recent one in the past and the set is the next one in the future; if the body is below the horizon now, both the rise and the following set are the next ones in the future. This guarantees that the displayed rise and set always describe a single continuous interval of visibility that contains the present moment.

The azimuth of each event is computed by evaluating the horizontal transform at the interpolated crossing time, so the rise and set compass bearings shown on the site are consistent with the times.

Horizon thresholds for the Sun and Moon

The Sun and Moon use body-specific thresholds. For the Sun, h₀ = −0.833°, which combines 34 arcminutes of refraction with the Sun's 16 arcminute semi-diameter, giving the conventional sunrise and sunset. For the Moon, h₀ = −0.125°, which uses the same refraction with the Moon's larger mean semi-diameter and a small parallax allowance.

Apparent magnitude

The brightness reported for each planet follows the standard IAU phase-function model. Each body has an absolute magnitude H (its brightness at 1 AU from both the Sun and the observer, at zero phase angle). The apparent magnitude is then:

m = H + 5·log₁₀(r·Δ) + phase term

where r is the heliocentric distance in AU and Δ is the geocentric distance in AU. The 5·log₁₀(r·Δ) term is the inverse-square dimming from the body's distance from the Sun and from Earth.

The phase angle i — the Sun–body–Earth angle — is found from the law of cosines applied to the heliocentric and geocentric distances:

cos i = (r² + Δ² − r_Earth²) / (2·r·Δ)

where r_Earth is Earth's heliocentric distance. The phase term applies a Lambertian-style correction that brightens the planet when it is nearly fully illuminated and dims it as the phase angle grows. The absolute magnitudes used are the standard published values for each planet (for example H = −4.47 for Venus, H = −9.4 for Jupiter).

The model reproduces the gross brightness behaviour of each planet — Venus brightening near greatest elongation and near inferior conjunction, Mars brightening dramatically near opposition — to within a few tenths of a magnitude. It does not attempt to capture the planet-specific phase functions (the strong opposition surge of Mars, the peculiar phase behaviour of Venus) that full photometric models include.

The Moon

The Moon is the fastest-moving body handled by the site and is treated with a dedicated, simplified longitude series rather than the full Keplerian machinery. Its geocentric ecliptic longitude is computed from the mean lunar arguments:

L′ = 218.3164477° + 481267.88123421°·T (mean longitude)
D = 297.8501921° + 445267.1114034°·T (mean elongation from the Sun)
M = 357.5291092° + 35999.0502909°·T (Sun's mean anomaly)
M′ = 134.9633964° + 477198.8675055°·T (Moon's mean anomaly)
F = 93.272095° + 483202.0175233°·T (argument of latitude)

A truncated principal-term series in these arguments is then added to L′ to give the Moon's apparent ecliptic longitude. The largest terms — the major evection, variation, and annual equation — are included; the many smaller terms of the full Brown/ELP series are omitted. The Moon's distance is taken as a fixed mean value (0.00257 AU) for the purpose of the horizon and magnitude calculations, so the reported lunar distance does not reflect the real perigee-to-apogee variation.

This is the single largest approximation in the site. It is acceptable because the Moon's position is used only to place it on the summary table and to determine its rise and set; the longitude error of a few tenths of a degree is comparable to the Moon's own apparent diameter and does not affect whether it is reported as visible. Users who need precise lunar ephemerides should consult the cross-check sources below.

Pluto

Pluto is propagated with the same Keplerian machinery as the eight planets, using its J2000 elements and rates. Because Pluto's orbit is both eccentric (e ≈ 0.25) and highly inclined (about 17°), the linear secular-rate model is less accurate for Pluto than for the major planets over long spans; near the present epoch the error remains small, but it grows more rapidly away from J2000 than for the other bodies. Pluto is included for completeness on the chart page and is not shown on the naked-eye summary table.

Aspects, houses and the chart page

The chart page additionally computes the Ascendant and Midheaven, the twelve equal houses, and the major aspects between bodies.

The Midheaven (MC) is the right ascension of the observer's meridian, obtained from the local sidereal time. The Ascendant is the ecliptic longitude rising on the eastern horizon, found from:

tan(Asc) = cos(RAMC) / (−sin(RAMC)·cos ε − tan φ·sin ε)

where RAMC is the right ascension of the midheaven. The twelve houses are then spaced at equal 30° intervals of ecliptic longitude from the Ascendant, which is the whole-sign convention.

Aspects are detected by comparing the angular separation of each pair of bodies against the classical aspect angles — conjunction (0°), sextile (60°), square (90°), trine (120°) and opposition (180°) — each with a fixed orb. Retrograde motion is flagged when a body's geocentric longitude decreases between consecutive days, which is the geocentric definition of retrogradation.

Geolocation and city data

The observer's latitude, longitude and time-zone offset come from one of three sources, in order of preference:

  • A city the visitor selects from the built-in list of major cities, each stored with its geographic coordinates and nominal time-zone offset.
  • A city the visitor searches for, resolved through the site's city-search lookup, which returns coordinates and an offset for the requested place.
  • The browser's geolocation API, when the visitor permits it, which provides latitude and longitude directly; the time-zone offset is then taken from the browser's local time zone.

The time-zone offset is supplied as a fixed number of hours relative to UT. Daylight-saving transitions are not modelled inside the calculation; visitors in a daylight-saving period should supply the offset currently in effect. Because the offset is applied only to convert local time to UT before the astronomical calculation, an error of one hour shifts every reported event by one hour but does not affect the geometry.

What is deliberately not modelled

To keep the computation lightweight and fully client-side, several small effects are omitted. For completeness they are listed here so that the boundary of the model is explicit:

  • Nutation of Earth's axis is not applied; mean obliquity and mean sidereal time are used throughout. The effect is well under an arcminute.
  • Light time — the delay between light leaving a planet and reaching Earth — is not corrected. Positions are geometric, not astrometric. For the outer planets this is a few arcminutes.
  • Aberration of light and annual parallax are neglected; both are small for the planets.
  • Topocentric parallax is not applied; positions are geocentric. For the Moon this can amount to about a degree, which is the main reason the lunar position is the least precise quantity on the site.
  • ΔT — the difference between Terrestrial Time and Universal Time — is not applied. The calculation uses UT directly as the dynamical argument. Over historical spans this matters; near the present epoch the error is a few arcseconds.
  • Higher-order secular terms in the orbital elements are omitted; only the linear rates are used.
  • Perturbations from the other planets are not added to the mean-longitude positions. The great Jupiter–Saturn perturbation and the Venus perturbation of Earth are the largest missing terms and account for most of the residual error of the model.

None of these omissions affects the observational use of the site. They are documented here so that anyone comparing the site's output against a high-precision ephemeris understands exactly which small terms will differ.

Cross-check sources

The output of every calculation described above is checked against independent, authoritative sources. The following are used to verify that the positions, rise/set times and magnitudes shown on Planet Summary are correct.

JPL HORIZONS

The NASA Jet Propulsion Laboratory's HORIZONS system, generated from the JPL DE-series numerical ephemerides (DE430/DE431 and successors), is the primary cross-check for planetary positions. For a given date, time and location, HORIZONS returns apparent right ascension, declination, altitude, azimuth, geocentric and heliocentric distance, and apparent magnitude. These are compared directly against the values produced by the site's library. Agreement to within a few hundredths of a degree in position and a few tenths of a magnitude in brightness is the acceptance criterion for the major planets.

The Astronomical Almanac

The yearly Astronomical Almanac, produced jointly by the United States Naval Observatory and HM Nautical Almanac Office, publishes daily positions of the Sun, Moon and planets together with the low-precision Keplerian element series on which this site's model is based. The element table and the published daily positions are used both as the source of the orbital elements and as an independent check on the propagated longitudes.

NASA JPL Solar System Dynamics

The JPL Solar System Dynamics group's planet fact sheets and small-body database provide the absolute magnitudes H used in the magnitude model, the physical parameters (diameters, masses, rotation periods) shown on the statistics page, and the moon data shown on the moons page. These are reference values rather than computed quantities.

United States Naval Observatory

The USNO provides rise, set and transit times for the Sun, Moon and planets for any location, computed from full numerical ephemerides. These are used to verify the horizon-crossing logic and the rise/set azimuths, particularly at high latitudes where the simple quadratic formula breaks down and the sampling method used here is most likely to differ from a naive implementation.

IMCCE / Paris Observatory

The Institut de mécanique céleste et de calcul des éphémérides provides independent online ephemerides for the planets and serves as a second, non-JPL check on positions and magnitudes. Agreement between HORIZONS and IMCCE, and between both and this site, is the strongest evidence that the model is correctly implemented.

Standard reference texts

The algorithms themselves are checked against the standard references for spherical astronomy and celestial mechanics: Jean Meeus's Astronomical Algorithms and Astronomical Formulae for Calculators, the Explanatory Supplement to the Astronomical Almanac, and W. M. Smart's Textbook on Spherical Astronomy. The Kepler-equation solver, the obliquity rotation, the sidereal-time formula and the horizon transform all follow the forms given in these works, and the rise/set sampling approach is validated against the analytic formulae in Meeus for cases where the latter are well conditioned.

Verification procedure

In practice, verification proceeds as follows. A set of dates spanning at least one full year, together with a set of locations spanning a wide range of latitudes, is run through the site's library. For each combination the geocentric ecliptic longitude, the right ascension and declination, the altitude and azimuth, the rise and set times, and the apparent magnitude are recorded. The same instants and locations are then queried in JPL HORIZONS and, where applicable, in the USNO and IMCCE services. The differences are tabulated.

Positions are accepted when the longitude difference is within a few hundredths of a degree for the inner planets and within about a tenth of a degree for the outer planets; rise and set times are accepted when they agree to within a minute or two (the dominant residual being the 2-minute sampling step and the fixed horizon refraction model); magnitudes are accepted when they agree to within a few tenths. Any systematic discrepancy beyond these tolerances is investigated and the relevant element, formula or threshold is corrected.

Frequently asked questions about the methodology

Are the positions geocentric or topocentric?

Geocentric. They are computed as if the observer were at the centre of Earth. The horizontal transform then projects the geocentric direction onto the observer's local horizon using their latitude and longitude. Topocentric parallax is not applied, which matters only for the Moon.

Are the positions apparent or geometric?

Geometric. Light-time, aberration and nutation are not corrected, so the positions are not the full "apparent" places of the Astronomical Almanac. The difference is small for the planets and is documented above.

Which equinox and ecliptic are used?

The J2000.0 mean equinox and ecliptic. The orbital elements, the obliquity and the sidereal-time formula are all referred to this single fixed frame, so there is no frame rotation between the elements and the horizon calculation.

Why are rise and set times sometimes a minute or two off from another source?

Three reasons. First, the horizon refraction model uses a fixed 34 arcminutes, whereas the real refraction depends on temperature and pressure. Second, rise and set are located by sampling altitude every 2 minutes and interpolating, which limits the timing precision to a fraction of that step. Third, some sources quote the geometric rise of the centre of the body, while this site quotes the appearance of the upper limb, which is earlier for rise and later for set.

Why does the Moon sometimes appear in the wrong sign?

The lunar longitude series is truncated to its principal terms, so the Moon's position can be off by a few tenths of a degree. Near a sign boundary this can place the Moon in the adjacent sign. This is the known limitation of the simplified lunar model and is the reason the Moon is described as the least precise body on the site.

Is Pluto a planet here?

Pluto is included on the chart page with the other bodies and is propagated with the same Keplerian model. It is not shown on the naked-eye summary table because it is far too faint to see without a substantial telescope. Its inclusion follows the traditional list of Solar System bodies and is not a classification statement.

How is the time zone handled?

The visitor's local time is converted to Universal Time by subtracting the supplied offset before any astronomy is done. The offset is a fixed number of hours; daylight saving is not computed internally. All astronomical events are computed in UT and then presented in the visitor's local time by adding the same offset back.

Where do the orbital elements come from?

From the J2000 mean-element table published by the Jet Propulsion Laboratory as part of its approximate Keplerian ephemeris, the same table reproduced in the Astronomical Almanac. The elements and their centennial rates are stored to the full precision of that table.

Can I reproduce these calculations?

Yes. Every formula on this page is a standard result of spherical astronomy and celestial mechanics, and the orbital elements are publicly published. An implementation following the sections above — Julian Day, Keplerian propagation with Newton's method, the ecliptic-to-equatorial rotation, mean sidereal time, and the horizontal transform — will reproduce the site's output to the stated accuracy. The cross-check sources listed above provide the reference values against which any such implementation can be validated.

If you have a specific question about a number shown on one of the other pages that this article does not answer, the chain is always: civil time → Julian Day → Keplerian propagation → heliocentric position → geocentric vector → ecliptic longitude (for the sign) or equatorial coordinates (for the horizon) → sidereal time → altitude and azimuth → horizon-crossing detection (for rise and set). Every figure on the site is the output of one link in that chain.

Find out more

How to Find Planets in the Night Sky