medievalPlanets.frink

Download or view medievalPlanets.frink in plain text format

// Identifying a medieval astronomical diagram
// https://mobile.twitter.com/MaxFagin/status/1619826334460678146

use planets.frink

g = new graphics
for p = [Planet.Mercury, Planet.Venus, Planet.Mars, Planet.Jupiter, Planet.Saturn]
{
   pl = new polyline
   
   for d = now[] to now[] + 2 year step 5 day
   {
      [ra, decl, dist] = p.geocentricCoordinates[d]
      epsilon = trueObliquityOfEcliptic[d]
      [lambda, beta] = raDeclToEcliptical[ra, decl, epsilon]
      pl.addPoint[beta, JD[d]]
   }

   g.color[randomFloat[0,.7], randomFloat[0,.7], randomFloat[0,.7]]
   [x,y] = first[pl.getPoints[]]
   g.text[p.getName[], x, y, "center", "bottom"]
   [x,y] = last[pl.getPoints[]]
   g.text[p.getName[], x, y, "center", "top"]
   g.add[pl]
}

pl = new polyline

for d = now[] to now[] + 2 year step 1 day
{
   [ra,decl] = moonApparentRADecl[d]
   epsilon = trueObliquityOfEcliptic[d]
   [lambda, beta] = raDeclToEcliptical[ra, decl, epsilon]
   pl.addPoint[beta, JD[d]]
}

g.color[randomFloat[0,.7], randomFloat[0,.7], randomFloat[0,.7]]
[x,y] = first[pl.getPoints[]]
g.text["Moon", x, y, "center", "bottom"]
[x,y] = last[pl.getPoints[]]
g.text["Moon", x, y, "center", "top"]
g.add[pl]

g.show[]
g.write["medievalPlanets.png", 300, 1000]


Download or view medievalPlanets.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 19996 days, 5 hours, 52 minutes ago.