drawJupiterSaturn.frink

Download or view drawJupiterSaturn.frink in plain text format


/** This draws the great 2020 conjunction of Jupiter and Saturn for any given
    date.  Try:

    frink drawJupiterSaturn.frink "2020-12-21 06:00 PM"

    for what is probably the closest visible nighttime approach for
    Denver, Colorado, USA

    You will need the 2020-08-09 release of planets.frink for this to work
    correctly.
*/


use planets.frink
lat =   40 deg North
long = 105 deg West

if length[ARGS] > 0
   d = parseDate[ARGS@0]
else
   d = now[]

[jaz, jalt] = Planet.Jupiter.refractedAzimuthAltitude[d, lat, long]
[saz, salt] = Planet.Saturn.refractedAzimuthAltitude[d, lat, long]

jrad = Planet.Jupiter.radiusAngle[d]
srad = Planet.Saturn.radiusAngle[d]

// Center on Saturn (because it moves the slowest in the sky)
g1 = Planet.drawSaturnRelativeToZenith[d, lat, long, (saz-saz) cos[-salt], -(salt-salt), srad, true, true]
g2 = Planet.drawJupiterMoonsRelativeToZenith[d, lat, long, (jaz-saz) cos[-salt], -(jalt-salt), jrad, true, true]

g = new graphics
g.add[g1]
g.add[g2]
g.invertGrays[].show[]

g.invertGrays[].write["drawJupiterSaturn.png", 1024, undef]
g.print[]


Download or view drawJupiterSaturn.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20217 days, 15 hours, 44 minutes ago.