manhattanhengemoon.frink

View or download manhattanhengemoon.frink in plain text format


// Program to calculate moon alignments with the East-West streets in
// Manhattan.

use sun.frink

North = +1
South = -1
West = +1
East = -1

lat = DMS[40,45,261.16] North
long = DMS[73,59,9.02] West

// Approximate direction of the streets.
// see http://en.wikipedia.org/wiki/Manhattanhenge
// http://www.charlespetzold.com/etc/AvenuesOfManhattan/index.html
axis = (270 + 29.008) degrees

// Conversion to coordinate system used by Meeus
axisMeeus = (axis + 180 degrees) mod circle

date = #2016-01-01 12:00#
dateOut = ### yyyy-MM-dd hh:mm:ss a zzz ###

sep = "\t"

while (date <= #2020-12-31#)
{
   date = moonSecantAzimuth[date, lat, long, axisMeeus]
   
   [azimuth, altitude] = refractedMoonAzimuthAltitude[date, lat, long]

   if (altitude > 0 deg)
   {
      print[(date -> [dateOut, "Eastern"]) + sep]
      print[format[JD[date],day,5] + sep]
      print[format[altitude,degrees,2] + sep]
      print[format[moonIlluminatedFraction[date], percent, 1] + sep]
      print[skyDarkness[date, lat, long] + sep]
      //   radiusAngle = moonRadiusAngle[date]
      println[]
   }
   
   date = date + 1 day
}


View or download manhattanhengemoon.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 17592 days, 15 hours, 25 minutes ago.