mithengeplanets.frink

Download or view mithengeplanets.frink in plain text format


// Program to calculate planet crossing of the Infinite Corridor at MIT
// known as "MIThenge"
//
// More info at also http://web.mit.edu/planning/www/mithenge.html
// Thanks to Keith Winstein, Ken Olum, Lenny Foner, and Matthias Huerlemann
// for various data and surveying assistance.
//
// For worked predictions, see https://futureboy.us/mithenge/
//
// Alan Eliasen, eliasen@mindspring.com

use mithengecorridor.frink
use cambridgetempFourier.frink
use sun.frink
use planets.frink

sep = "\t"
preamble = ""

if length[ARGS] > 0 && ARGS@0 == "--html"
{
   sep = "<TD>"
   preamble = "<TR><TD>"
}

dateOut = ### yyyy-MM-dd hh:mm:ss a zzz ###

for planet = Planet.planetsMinusEarth
{
   date = beginningOfYear[now[]]
   end = beginningOfYearPlus[now[], 2]
   while (date < end)
   {
      temperature = cambridgeTemp[date]
      date = planet.secantAzimuth[date, lat, long, corridorAzimuthMeeus, temperature, pressure]
      
      [azimuth, altitude] = planet.refractedAzimuthAltitude[date, lat, long, temperature, pressure]
      print[preamble]
      print[planet.getName[] + sep]
      print[(date -> [dateOut, "Eastern"]) + sep]
      print[format[JD[date],day,5] + sep]
      print[format[altitude,degrees,2] + sep]
      print[format[F[temperature],1,0]]
      if altitude < (0.91 degrees) and altitude > 0 degrees
         print["$sep+ " + skyDarkness[date,lat, long]]

      println[]
      
      date = date + 1 day
   }
}


Download or view mithengeplanets.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 19935 days, 9 hours, 16 minutes ago.