convergatron.frink

Download or view 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]

d1 = beginningOfYear[now[]]
d2 = beginningOfYearPlus[now[], 2]
for d = d1 to d2 step 12 hours
{
   [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]]
      }
   }
}


Download or view 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 20136 days, 5 hours, 23 minutes ago.