Bearing to Yerushalayim and Zmanim Map



Did you ever find yourself unsure of the correct bearing (direction) to Yerushalayim (Jerusalem)? The new Zmanim/Bearing to Yerushalayim map will help you find it very easily. The map draws two lines from your location to Yerushalayim. The blue line uses the commonly used (לבוש Levush and others) rhumb line (a straight line on a Mercator projection map), while the green line shows the great circle route (Rabbi Aviad Sar Shalom Basilea הרב אביעד שר שלום באזילה in his אמונת חכמים Emunas Chachamim and others) on a map. While it appears that the circle line is not a straight line, on a globe, the shortest (and straightest) line between two points follows the great circle route. Future posts will detail the technical aspects of the work involved. For additional information of the correct bearing for tefila, see Rabbi Yehuda Herskowitz’s article in Yeshurun volume III page 586 and Rabbi Gavriel Goetz comprehensive pamphlet Gevuras Moishe on the subject.

How to Use

Find your exact location on the map by dragging the marker to your exact location or by clicking anywhere on the map. You can also click on the search button and enter your location (such as “Lakewood, NJ” (the default), “Vilnius, Lithuania”) or just enter a zip code (Canadian or British postal codes work as well) to zoom in on your location. Changing to satellite view and zooming in farther will make the job easier (assuming that you can identify your roof). Once the red marker is centered on your location, click the red marker to show your exact latitude, longitude and bearing to Yerushalayim in an info window. There are two additional tabs that show today’s zmanim. You can click on the “Link” button to refresh the page with the URL that contains coordinates to the currently displayed map with its zoom level so that it can be bookmarked or emailed.
I would like to thank Rabbi Yehuda Herskowitz for his excellent article and additional information that he provided.

Known Issues

Google Maps API Bugs (All Fixed by Google)

  1. Zmanim data sometimes fails to show in Firefox. This seems to be a bug in the Google Maps API when dealing with synchronous AJAX calls.
  2. Locations close to 180° from Yerushalayim (Alaska is a good test case) sometimes shows an incorrect rhumb line bearing (though the circle route shows correctly). The information in the info widow is correct. This is a known issue with the Google Maps API.
  3. Related to the above issue, sometimes the lines are drawn a “world away” and horizontal scrolling of the map is required to see the lines. Again this is a known Google Maps issue.

To Do (related to Zmanim)

  1. Support Daylight savings time (supported by the timezone webservice used, but not yet implemented in the map).
  2. Link to a yearly calendar.
  3. Elevation lookup (already available in the yearly calendar).
  4. Allow changing of the date.

Note that it is not clear that the Levush was of the opinion that the rhumb line should be used.

Zmanim Clock Applet Alpha Release

Java Logo Sepia
Note: Java Applets are obsolete, and the applet is no longer available
A while ago, Dr. Irv Bromberg mentioned to me, that my Zmanim API was in use in the Astronomical Clock Applet created by Ali Adams. The applet was a modification to Antony Pranata’s clock applet that displayed Islamic prayer times. Apparently the Zmanim API was so flexible that without any modification it was able to be used for generating “zmanim” well beyond anything I had envisioned. At Dr. Bromberg’s suggestion I modified the clock applet to display zmanim. Using the same Google Map API used in the Calendar Generator, I created the Zmanim Clock page (no longer available). The clock on the Clock page is very configurable, and allows selection of the location, zmanim etc. I contacted Antony Pranata, the original author of the clock who allowed my to release it under the GPL. An easy to use downloadable version will be made available in the near future. For those who think that the clock is upside down, there are more than enough configuration options to tweak the clock to your heart’s content.

Zmanim Calendar Generator Back Up (With Proper DST Rules)

Sunrise CalendarThe Zmanim Calendar Generator has been back up for about 2 weeks, but due to a downgrade in the Java version used, the DST issue that was as mentioned as fixed in a previous post returned. This has now been fixed using the Timezone Updater Tool. Please let me know if you run into any issues.

Calculation of Zmanim VS Other Sites

A user contacted me with the following note (some details removed).

Could you please explain to me why there seems to be nearly a three-minute discrepancy between the zemanim for XXXXX, NJ at 20 meters (exact location) and those listed for 20 meters on the MyZmanim.com site. Your site calculates 4/20 at 6:08:20 and theirs has it at 6:11:25….

I really can’t comment on the MyZmanim.com site since their code is not open source and I do not know the exact algorithm they use. The Zmanim Project code used here has 2 different algorithms available for calculating zmanim, one using the algorithm published by the USNO (US Naval Observatory), and the other from the NOAA (National Oceanic and Atmospheric Administration). I have 2 different implementations of the USNO algorithm (one has since been removed as a duplicate), and both return the exact time to the millisecond, so I believe that the code is a correct implementation of the USNO algorithm. You can look through the code at my site and see if you find any issues. Having said that, I did a comparison between MyZmanim.com and my site using the USNO algorithm and both sites are within seconds (all calculations were for April 19 for XXXXX, NJ):

Site Algorithm Elevation
in Meters
Sunrise
Time
MyZmanim ? 0 6:12:16
MyZmanim ? 20 6:11:25
KosherJava USNO 0 6:12:18
KosherJava USNO 20 6:11:31
KosherJava NOAA 0 6:10:11
KosherJava NOAA 20 6:09:24

Based on this chart, the sunrise difference between KosherJava.com using USNO and MyZmanim.com who are probably also using the USNO algorithm is 3 seconds for sea level and 6 seconds at 20-meter elevation (see below for why the elevation calculation has this additional 3-second discrepancy). Keep in mind that while I was able to zoom in to the user’s exact location using the Google Map interface, myZmanim.com is using a zip code level calculation, and they might be calculating using a slightly different location.
I believe that the times the user was referring to in his note were generated using the NOAA algorithm implementation. As mentioned above, at this point I have no information to indicate what algorithm is more accurate, and I will hopefully one day post more information on the accuracy of these algorithms.

As far as the elevation calculation, I use the formula

zenith = zenith + Math.toDegrees(Math.acos(earthRadiusInMeters / (earthRadiusInMeters + elevationMeters)));

found in Calendrical Calcuations, as mentioned on the Zmanim Calendar Generator page. For this time of year and the XXXXX location and a 20 meter elevation returns a time 47 seconds earlier than sea level using my calculation, and 51 seconds earlier using myZmanim.com. I reran the calculation using the more commonly used but less accurate formula of

adding 0.0347 * squareRoot(elevationMeters) to the zenith

that is mentioned in the Maaglay Tzedek written by Rabbi Moshe Kosower (as mentioned in the JavaDocs and Calendar Generator page) and the difference between the 0 and 20 meter elevation was the same 51 seconds that appeared in MyZmanim.com. Besides relying on the more accurate calculation mentioned in Calendrical Calculations (considered the most authoritative book on calendars and astronomical time calculations), I spoke to Professor Moshe Koppel a few years ago about the subject and he validated the Calendrical Calculations algorithm (a seemingly common mathematical calculation). Looking back at the Maaglay Tzedek, it seems that this calculation includes changes to the refraction caused by the elevation, and I will have to research the subject some more. All this elevation difference boils down to an insignificant 3 second difference. Keep in mind that atmospheric refraction will have a much greater impact than this. Even if one were to know the exact atmospheric pressure, temperature and humidity, this varies in different parts of the atmosphere and would be extremely hard to calculate without measuring it at all elevations of the atmosphere. Please make sure to speak to a posek before using the time with elevation.