convergatron.frink

View or download convergatron.frink in plain text format


// This program calculates the angular separations of all the different
// pairs of planets in the sky (and the moon).  The output is a large table
// of separations suitable for graphing.

use planets.frink

df = ### yyyy-MM-dd-HH:mm ###

lp = length[Planet.planetsMinusEarth]

for d = #2015-10-01 9:00 PM# to #2016-12-31# step 1 day
{
   [mra, mdecl] = moonApparentRADecl[d]
   for i1 = 0 to lp-1
   {
      p1 = Planet.planetsMinusEarth@i1

      // Check for moon convergences
      [ra1, decl1] = p1.geocentricCoordinates[d]
      dist = angularSeparation[mra, mdecl, ra1, decl1]
      println[(d->df) + "\tMoon\t" + p1.getName[] + "\t" + format[dist,degrees,5]]

      // Check for planet-planet convergences
      for i2 = i1+1 to lp-1
      {
         p2 = Planet.planetsMinusEarth@i2
         if p1 == p2
            next
         
         [ra2, decl2] = p2.geocentricCoordinates[d]
         dist = angularSeparation[ra1, decl1, ra2, decl2]
         println[(d->df) + "\t" + p1.getName[] + "\t" + p2.getName[] + "\t" + format[dist,degrees,5]]
      }
   }
}


View or download convergatron.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 17891 days, 12 hours, 14 minutes ago.