<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KosherJava &#187; Davening</title>
	<atom:link href="http://www.kosherjava.com/tag/davening/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kosherjava.com</link>
	<description>A weblog about Zmanim, Kosher Coffee (Kosher Java) and other odds &#38; ends</description>
	<lastBuildDate>Fri, 06 Jan 2012 18:28:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bearing to Yerushalayim and Zmanim Map 3.0</title>
		<link>http://www.kosherjava.com/2011/09/11/bearing-to-yerushalayim-and-zmanim-map-3-0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bearing-to-yerushalayim-and-zmanim-map-3-0</link>
		<comments>http://www.kosherjava.com/2011/09/11/bearing-to-yerushalayim-and-zmanim-map-3-0/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 01:53:34 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[Timezone]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=1298</guid>
		<description><![CDATA[The Bearing to Yerushalayim and Zmanim Map was recently updated to version 3.0. This new release adds a number of new features to the Zmanim Map version 2.0 update released in March 2010. The main change was updating the Google Map API version from the deprecated v2 to v3. This change increases performance and adds [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/sepiaMap.jpg" alt="World map" title="World map" />The <a href="http://www.kosherjava.com/maps/zmanim.html">Bearing to Yerushalayim and Zmanim Map</a> was recently updated to version 3.0. This new release adds a number of new features to the <a href="http://www.kosherjava.com/2010/03/14/bearing-to-yerushalayim-and-zmanim-map-2-0/">Zmanim Map version 2.0 update</a> released in March 2010. The main change was updating the Google Map API version from the deprecated <a href="http://code.google.com/apis/maps/documentation/javascript/v2/">v2</a> to <a href="http://code.google.com/apis/maps/documentation/javascript/">v3</a>. This change increases performance and adds much better support for mobile browsers. The upgrade also means that a Google Maps API key is no longer required. This makes it easy to drop it into any site without any configuration (<a href="http://www.kosherjava.com/contact/">contact me</a> for details). <img class="alignright" src="/images/zmanimTabV3.png" alt="Zmanim tab v3" title="Zmanim tab v3" />The technical notes on the original <a href="http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/">Technical Information about the Bearing to Yerushalayim Map</a> post are still relevant, with very little having changed since the initial implementation. 

The following is a partial list of the new features:
<ul>
<li>A number of additional zmanim in the More Zmanim tab, including <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ComplexZmanimCalendar.html#getTchilasZmanKidushLevana3Days()">tchilas</a> and <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ComplexZmanimCalendar.html#getSofZmanKidushLevanaBetweenMoldos()">sof zman kiddush levana</a> (if they occur on that day)
</li><li>A link to download a 12 month Zmanim calendar directly from the map (using the same spreadsheet used in the <a href="http://www.kosherjava.com/zmanim-project/zmanim-calendar-generator/">Zmanim Calendar Generator</a>). Clicking on the link from the Zmanim tab will generate a calendar with most typically used zmanim, while clicking on the link in the More Zmanim tab will download the full set of zmanim. These are available as the Calendar Type option in the Zmanim Calendar Generator</li>
<li>Increased use of <a href="http://jquery.com/">jQuery</a> and jQuery UI for formatting the zmanim tables to better match the site look &amp; feel</li>
<li>Refactoring to make the code more robust and slightly more maintainable</li>
<li>Timezones for all of Israel now display the timezone of Asia/Jerusalem as opposed to the Asia/Gaza returned for parts of Israel by the <a href="http://www.geonames.org/export/web-services.html">GeoNames TimeZone web service</a></li>
</ul>

From a technical perspective there were a number of changes required due to updating the Google Maps API from v2 to v3. These include:

<ul>
<li>v3 no longer supports <a href="http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMap2.openInfoWindowTabs">tabbed info windows</a>, so the tabs are now implemented using <a href="http://jqueryui.com/">jQuery UI</a></li>
<li>Renaming of a number of classes and functions such as GLatLng to LatLng</li>
<li>A number of functions that were part of API v2 were removed in v3. One example is the removal of <a href="http://en.wikipedia.org/wiki/Radian">radians</a> in the LatLng that had been available as <a href="http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GLatLng.latRadians">GLatLng.latRadians()</a>. These missing functions required for the direction to Yerushalayim calculations are now supported in the Zmanim Map using <a href="http://en.wikipedia.org/wiki/JavaScript#Prototype-based">prototypes</a></li>
</ul>


]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2011/09/11/bearing-to-yerushalayim-and-zmanim-map-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Davening Direction from Alaska</title>
		<link>http://www.kosherjava.com/2011/01/17/davening-direction-from-alaska/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=davening-direction-from-alaska</link>
		<comments>http://www.kosherjava.com/2011/01/17/davening-direction-from-alaska/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 04:12:15 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[Geodesic]]></category>
		<category><![CDATA[geoid]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[WGS84]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=734</guid>
		<description><![CDATA[As mentioned briefly in the &#8220;Why Some Zmanim Never Occur&#8221; post, the Lubavitch Jewish Center of Anchorage, Alaska has an interesting davening direction question. As explained in the &#8220;Bearing to Yerushalayim and Zmanim Map&#8221; (additional technical information is available in the &#8220;Technical Information about the Bearing to Yerushalayim Map&#8221; post), there are two opinions about [...]]]></description>
			<content:encoded><![CDATA[<iframe style="float: left; margin: 10px;" src="/maps/zmanim.html?lat=61.189412&#038;lng=-149.86042&#038;zoom=18&#038;z=n" height="300" width="300" frameborder="0"></iframe>As mentioned briefly in the <a href="http://www.kosherjava.com/2010/06/02/faq-why-some-zmanim-never-occur-developers-beware/">&#8220;Why Some Zmanim Never Occur&#8221;</a> post, the <a href="http://lubavitch.com/centers/detail.html?id=389">Lubavitch Jewish Center of Anchorage, Alaska</a> has an interesting <a href="http://en.wikipedia.org/wiki/Davening">davening</a> direction question. As explained in the <a href="http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/">&#8220;Bearing to Yerushalayim and Zmanim Map&#8221;</a> (additional technical information is available in the <a href="http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/">&#8220;Technical Information about the Bearing to Yerushalayim Map&#8221;</a> post), there are two opinions about the proper direction to face during Tfilah. The <a href="http://en.wikipedia.org/wiki/Mordecai_Yoffe">Levush</a> and others are of the opinion that one should face the <a href="http://en.wikipedia.org/wiki/Rhumb_line">rhumb line</a> direction to Yerushalayim, while the Emunas Chachamim and others are of the opinion that one should face the initial bearing of the <a href="http://en.wikipedia.org/wiki/Great_circle">great circle</a> route. Both of these opinions would clearly use the shortest rhumb or great circle lines to Yerushalayim. As an example, a person standing on <a href="http://en.wikipedia.org/wiki/Mount_of_Olives">Har Hazaisim</a> a mile east of <a href="http://en.wikipedia.org/wiki/Temple_Mount">Har Habayis</a> would not daven east using the logic that continuing east for approximately 21,175 miles<sup style="color: red">[1]</sup> would reach Yerushalayim via <a href="http://en.wikipedia.org/wiki/Circumnavigation#Global_circumnavigation">global circumnavigation</a>, when Har Habayis is just one mile west of him. The <a href="http://www.kosherjava.com/maps/zmanim.html?lat=61.189412&#038;lng=-149.86042&#038;zoom=17">shul in Anchorage</a> is located at a longitude of -149.86042°. The <a href="http://en.wikipedia.org/wiki/Antipodes">antipode</a> of Har habayis is on the -144.764851 longitude line &#8211; 180° of longitude from Har Habayis. People on different sides of this line will daven in opposite directions. Anchorage with a longitude of -149.86042° is 169.69 miles (273.1 km) west of the the -144.764851° longitude line<sup style="color: red">[2]</sup>. For this reason, the shul should daven not east, but west (255.78° from the north, or slightly south-west) if using the common rhumb line calculation, or north (355.67° from the north, or slightly west of north) if using the great circle calculation. Alaska is the only location in the world that has the -144.764851° longitude line cut across dry land, and is therefore the only non-ocean location to face this issue.


<hr />
Notes:
 <span style="color: red">1</span>. Based on a rhumb line <a href="http://home.online.no/~sigurdhu/Grid_10min.htm">along the 31° 50&#8242;</a> <a href="http://en.wikipedia.org/wiki/Circle_of_latitude">circle of latitude</a> as opposed to 24,901 miles at the equator) using a <a href="http://en.wikipedia.org/wiki/World_Geodetic_System">WGS84</a> <a href="http://en.wikipedia.org/wiki/Reference_ellipsoid">Reference ellipsoid</a>.
<span style="color: red">2</span>. Rhumb line calculation as calculated by <a href="http://www.movable-type.co.uk/scripts/latlong.html">Movable Type</a> using the same latitude for both points. The ellipsoidal shape of the earth is factored into this calculation. The short distance means that the 169.66 (272.98 km) great circle distance is very close to the rhumb line distance.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2011/01/17/davening-direction-from-alaska/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bearing to Yerushalayim and Zmanim Map 2.0</title>
		<link>http://www.kosherjava.com/2010/03/14/bearing-to-yerushalayim-and-zmanim-map-2-0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bearing-to-yerushalayim-and-zmanim-map-2-0</link>
		<comments>http://www.kosherjava.com/2010/03/14/bearing-to-yerushalayim-and-zmanim-map-2-0/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 05:32:53 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[daylight savings time]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[Timezone]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=436</guid>
		<description><![CDATA[The availability of the Bearing to Yerushalayim and Zmanim Map was originally announced on December 30, 2007. At the time there were a number of bugs related to the Google Map API. These bugs were reported to Google and eventually fixed. Since that time, the only change was a minor JavaScript fix for IE. The [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/sepiaMap.jpg" alt="World map" title="World map" />The availability of the <a href="http://www.kosherjava.com/maps/zmanim.html">Bearing to Yerushalayim and Zmanim Map</a> was <a href="http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/">originally announced on December 30, 2007</a>. At the time there were a number of bugs related to the <a href="http://code.google.com/apis/maps/">Google Map API</a>. These bugs were reported to Google and eventually <a href="http://code.google.com/p/gmaps-api-issues/issues/list?can=1&#038;q=status%3AFixed%20reporter%3Akosherjava">fixed</a>. Since that time, the only change was a minor JavaScript fix for IE. The Bearing to Yerushalayim worked, but the zmanim tabs had a major issue because the timezone calculated was done based on the user&#8217;s current browser timezone. This made it tricky to check zmanim in a different location or timezone than the user&#8217;s current timezone. <img class="alignright" src="/images/zmanimTab.png" alt="Zmanim tab using timezones" title="Zmanim tab using timezones" />I recently updated the map to look-up the actual timezone of the latitude and longitude selected by the user. This was implemented by doing a look-up at the <a href="http://www.geonames.org">geonames.org</a> <a href="http://www.geonames.org/export/web-services.html">timezone  web-service</a>. The timezone is passed to the Zmanim API and used to generate the XML output of a list of daily zmanim that is displayed in the map. Since the <a href="http://en.wikipedia.org/wiki/Zoneinfo">Olson timezone database</a> changes a few times a year, there will almost certainly be cases where the proper timezone can&#8217;t be determined.  Some of these are changes of timezone names, such as the change from Asia/Calcutta to Asia/Kolkata (my host will not run the <a href="http://java.sun.com/javase/timezones/#tzu">TZ Updater tool</a>). In these cases a simple mapping between the old and new was added to the map. In cases where the timezone can&#8217;t be determined the timezone will default to GMT.  Ocean locations within 10 km of land will use the closest landmass, but anywhere beyond 10 km will default to GMT. One issue with using the geonames.org webservice, is that when it is down, the map will timeout. I experimented with various ways of dealing with this, but unless my host updates the Java version from 1.4, they are too complex to use at this time.

See the <a href="http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/">Technical Information about the Bearing to Yerushalayim Map</a> post for technical details about the original implementation.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2010/03/14/bearing-to-yerushalayim-and-zmanim-map-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating the Bearing/Direction to Har Habayis Using the Zmanim API</title>
		<link>http://www.kosherjava.com/2009/11/29/calculating-the-bearing-to-har-habayis-using-the-zmanim-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=calculating-the-bearing-to-har-habayis-using-the-zmanim-api</link>
		<comments>http://www.kosherjava.com/2009/11/29/calculating-the-bearing-to-har-habayis-using-the-zmanim-api/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 04:28:14 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[geoid]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[WGS84]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=322</guid>
		<description><![CDATA[An earlier &#8220;Bearing to Yerushalayim and Zmanim Map&#8221; post demonstrated the use of JavaScript to render the bearing to Har Habayis on a Google Map. A more detailed follow-up post &#8220;Technical Information about the Bearing to Yerushalayim Map&#8221; dealt with detailed technical information on these calculations. The main Bearing to Yerushalayim and Zmanim Map page [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/javaDir.png" alt="Java direction"/>An earlier <a href="http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/">&#8220;Bearing to Yerushalayim and Zmanim Map&#8221;</a> post demonstrated the use of JavaScript to render the bearing to <a href="http://en.wikipedia.org/wiki/Temple_Mount">Har Habayis</a> on a <a href="http://www.kosherjava.com/maps/zmanim.html">Google Map</a>. A more detailed follow-up post <a href="http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/">&#8220;Technical Information about the Bearing to Yerushalayim Map&#8221;</a> dealt with detailed technical information on these calculations. The main <a href="http://www.kosherjava.com/zmanim-project/bearing-to-yerushalayim-and-zmanim-map/">Bearing to Yerushalayim and Zmanim Map</a> page usually has the most up to date information on the subject. What was not detailed in previously published posts and pages was that most of the calculations available via <a href="http://en.wikipedia.org/wiki/Javascript">JavaScript</a> are now in the core <a href="http://www.kosherjava.com/zmanim-project/">Zmanim API</a>. Available since the July, 2008 <a href="http://www.kosherjava.com/2008/07/17/zmanim-api-11-beta-2-released/">beta 2 release</a> of <a href="http://www.kosherjava.com/zmanim-project/downloads/">version 1.1</a> is the ability to bearings/directions using both the <a href="http://en.wikipedia.org/wiki/Great_circle">great circle</a> and <a href="http://en.wikipedia.org/wiki/Rhumb_line">rhumb line</a> methods in <a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a>. The <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/GeoLocation.html">GeoLocation Object</a> was modified to calculate the great circle bearings (both <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/GeoLocation.html#getGeodesicInitialBearing(net.sourceforge.zmanim.util.GeoLocation)">initial</a> and <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/GeoLocation.html#getGeodesicFinalBearing%28net.sourceforge.zmanim.util.GeoLocation%29">final</a>), and <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/GeoLocation.html#getRhumbLineBearing%28net.sourceforge.zmanim.util.GeoLocation%29">rhumb line bearing</a> from any GeoLocation Object to another. In addition, distance calculation between the two points using both of these line types is supported. What was not <a href="http://en.wikipedia.org/wiki/Porting">ported</a> from the JavaScript version was the less accurate <a href="http://en.wikipedia.org/wiki/Haversine_formula">Haversine formula</a>, or the simpler <a href="http://en.wikipedia.org/wiki/Spherical_trigonometry">spherical law of cosines</a> algorithms that yield identical results. Instead, the Zmanim API uses the far more accurate Vincenty formulae using the <a href="http://en.wikipedia.org/wiki/WGS84">WGS84</a> <a href="http://en.wikipedia.org/wiki/Geoid">geoid</a> model of the earth. Published by the geodesist/mathematician <a href="http://en.wikipedia.org/wiki/Thaddeus_Vincenty">Thaddeus Vincenty</a>, it is said to be accurate to about one-half millimeter, more than adequate for our calculation. The code in the API is a Java port of the previously published, slightly <a href="http://www.kosherjava.com/maps/glatlng.js">modified</a> version of <a href="http://www.movable-type.co.uk/">Chris Veness&#8217;s</a>  <a href="http://www.movable-type.co.uk/scripts/latlong-vincenty.html">JavaScript  implementation</a> . Below is a simple Java example of generating bearing and distances.

<pre class="brush: java; title: ; notranslate">
/**
 * This program demonstrates how to calculate bearing to Yerushalayim
 * using the kosherjava.com Zmanim API. Both the great circle and
 * rhumb line method are shown
 * To compile, ensure that the Zmanim Jar is in your classpath.
 */
import net.sourceforge.zmanim.util.GeoLocation;
import java.util.TimeZone;

public class BearingToYerushalayim{
	public static void main(String [] args) {
		GeoLocation lakewood = new GeoLocation(&quot;Lakewood, NJ&quot;, 40.09596, -74.22213, 0, TimeZone.getTimeZone(&quot;America/New_York&quot;));
		GeoLocation harHabayis = new GeoLocation(&quot;Har Habayis&quot;, 31.77805, 35.235149, 0, TimeZone.getTimeZone(&quot;Asia/Jerusalem&quot;));

		double greatCircleInitialBearing = lakewood.getGeodesicInitialBearing(harHabayis);
		double greatCircleDistance = lakewood.getGeodesicDistance(harHabayis);

		double rhumbLineBearing = lakewood.getGeodesicInitialBearing(harHabayis);
		double rhumbLineDistance = lakewood.getRhumbLineDistance(harHabayis);

		System.out.println(&quot;Great circle initial bearing: &quot; + greatCircleInitialBearing + &quot; degrees &quot;);
		System.out.println(&quot;Great circle distance: &quot; + greatCircleDistance/1000 + &quot; KM&quot;);

		System.out.println(&quot;Rhumb line bearing: &quot; + rhumbLineBearing + &quot; degrees&quot;);
		System.out.println(&quot;Rhumb line distance: &quot; + lakewood.getRhumbLineDistance(harHabayis)/1000 + &quot; KM&quot;);

	}
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2009/11/29/calculating-the-bearing-to-har-habayis-using-the-zmanim-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technical Information about the Bearing to Yerushalayim Map</title>
		<link>http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=technical-information-about-the-bearing-to-yerushalayim-map</link>
		<comments>http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 00:24:59 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[Geodesic]]></category>
		<category><![CDATA[geoid]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[Tfilah]]></category>
		<category><![CDATA[WGS84]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/</guid>
		<description><![CDATA[I have been asked a number of questions recently about the directional accuracy of the Bearing to Yerushalayim and Zmanim Map calculations. The rhumb line calculations are very straight forward and I will not spend much time on it in this article. As a side note, for those interested in the subject, I would like [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/sepiaMap.jpg" alt="World map" title="World map" />I have been asked a number of questions recently about the directional accuracy of the <a href="http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/">Bearing to Yerushalayim and Zmanim Map</a> calculations. The <a href="http://en.wikipedia.org/wiki/Rhumb_line">rhumb line</a> calculations are very straight forward and I will not spend much time on it in this article. As a side note, for those interested in the subject, I would like to mention that Rabbi Gavriel Goetz recently published a very comprehensive pamphlet Gevuras Moishe on the subject and it is well worth reading.
My original calculations and implementation of the <a href="http://en.wikipedia.org/wiki/Great_circle">great circle</a> route (geodesic line) used simple <a href="http://en.wikipedia.org/wiki/Spherical_trigonometry">spherical trigonometry</a> to calculate the initial bearing (and distance) based on a sphere using an <a href="http://en.wikipedia.org/wiki/Earth_radius">authalic mean radius</a> of 6371 km. These calculations were very similar to the method used by Rabbi Yehuda Herskowitz&#8217;s article in <a href="http://hebrewbooks.org/pdfpager.aspx?req=20264&#038;st=&#038;pgnum=596">Yeshurun volume III page 586</a>. This model of the earth is more than accurate enough for these calculations (you would need a very accurate “nose alignment” and the total lack of <a href="http://en.wikipedia.org/wiki/Shuckling">shuckling</a> to even get within a degree of being correct). Google Maps API, Yahoo Maps and Microsoft’s Live Maps for simplicity sake, all use very similar calculations as mentioned in the <a href="http://web.archive.org/web/20070908081438/http://cfis.savagexi.com/articles/2006/05/03/google-maps-deconstructed">cfis blog (archived)</a> quoting  <a href="http://www.sharpgis.net/">Morten Nielsen</a><blockquote>Google Maps / Virtual Earth / Yahoo Maps(?) all use a spherical datum based on WGS84. That is, it has the same center, orientation and scale as WGS84, but has no flattening. The radius of the sphere is the same as the semi-major axis of WGS84 (6378137 meters).</blockquote> Using a sphere, all the above mentioned mapping APIs use <a href="Spherical trigonometry">spherical law of cosines</a> formula for the calculations, that yield an <a href="http://www.movable-type.co.uk/scripts/latlong.html">identical result</a> to the more complex <a href="http://en.wikipedia.org/wiki/Haversine_formula">Haversine formula</a>. 

Curious how accurate these calculations really are, being based on a perfect sphere and not the <a href="http://en.wikipedia.org/wiki/Oblate_spheroid">oblate ellipsoid/spheroid</a> that the earth actually is, I started looking into the subject a little more. The most accurate current <a href="http://en.wikipedia.org/wiki/Geoid">geoid</a> model of the earth is the <a href="http://en.wikipedia.org/wiki/WGS84">WGS84</a> model.  The geodesist/mathematician <a href="http://en.wikipedia.org/wiki/Thaddeus_Vincenty">Thaddeus Vincenty</a> published the Vincenty formulae for this type of calculation that is said to be accurate to about one-half millimeter, more than adequate for our calculation. <a href="http://www.movable-type.co.uk/">Chris Veness</a> <a href="http://www.movable-type.co.uk/scripts/latlong-vincenty.html">implemented this formula</a> in JavaScript and released it under the LGPL, making it very simple to use. I slightly <a href="http://www.kosherjava.com/maps/glatlng.js">modified</a> his work to allow easier interaction with the Google Maps API. The implementation that I used when I finally published the map on December 30, 2007 uses the Vincenty formula with the WGS84 geoid model (the Vincenty formula can easily be used with different goeiod models). The table below shows a comparison of the results for the initial bearing and distances of the different calculations based an a Lakewood, NJ (latitude: 40.095965&deg;, longitude: -74.22213&deg;) to Har Habayis (latitude: 31.77805&deg;, longitude: 35.235149&deg;) example.

<table>
<tr>
    <th>Calculation Method</th>
    <th>Initial Bearing</th>
    <th>Distance</th>
</tr>
<tr>
    <td>6,371 km (authalic mean radius) sphere using spherical trigonometry</td>
    <td style="white-space: nowrap">53.86555&deg;</td>
    <td style="white-space: nowrap">9224.67442 km</td>
</tr>
<tr>
    <td>Google Maps API 6,378.137km (WGS84 equatorial mean radius) sphere using spherical trigonometry</td>
    <td style="white-space: nowrap">N/A</td>
    <td style="white-space: nowrap">9235.00819 km</td>
</tr>
<tr>
    <td>Vincenty formula using a WGS84 geoid</td>
    <td style="white-space: nowrap">53.81786&deg;</td>
    <td style="white-space: nowrap">9244.61686 km</td>
</tr>
<tr>
    <td>rhumb line</td>
    <td style="white-space: nowrap">95.37152&deg;</td>
    <td style="white-space: nowrap">9891.16074 km</td>
</tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2008/04/07/technical-information-about-the-bearing-to-yerushalayim-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bearing to Yerushalayim and Zmanim Map</title>
		<link>http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bearing-to-yerushalayim-and-zmanim-map</link>
		<comments>http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 17:06:17 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Davening]]></category>
		<category><![CDATA[Geodesic]]></category>
		<category><![CDATA[geoid]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Great Circle]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Rhumb Line]]></category>
		<category><![CDATA[Tfilah]]></category>
		<category><![CDATA[WGS84]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/</guid>
		<description><![CDATA[Did you ever find yourself unsure of the correct bearing (direction) to Yerushalayim (Jerusalem)? &#160; The new Zmanim/Bearing to Yerushalayim map will help you find it very easily. &#160;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 [...]]]></description>
			<content:encoded><![CDATA[<iframe src="/maps/zmanim.html?z=n" height="400" width="600" frameborder="0"></iframe>
<br />Did you ever find yourself unsure of the correct <a href="http://en.wikipedia.org/wiki/Bearing_%28navigation%29">bearing</a> (direction) to Yerushalayim (Jerusalem)? &nbsp; The new <a href="http://www.kosherjava.com/maps/zmanim.html">Zmanim/Bearing to Yerushalayim map</a> will help you find it very easily. &nbsp;The map draws two lines from your location to Yerushalayim. The blue line uses the commonly used (Levush and others)  <a href="http://en.wikipedia.org/wiki/Rhumb_line">rhumb line</a> (a straight line on a <a href="http://en.wikipedia.org/wiki/Mercator_projection">Mercator projection</a> map), while the green line shows the <a href="http://en.wikipedia.org/wiki/Great_circle">great circle route</a> (Emunas Chachamim and others) on a map. &nbsp; 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. &nbsp; Future posts will detail the technical aspects of the work involved. &nbsp; For additional information of the correct bearing for tefila, see Rabbi Yehuda Herskowitz&apos;s article in <a href="http://hebrewbooks.org/pdfpager.aspx?req=20264&#038;st=&#038;pgnum=596">Yeshurun volume III page 586</a> and Rabbi Gavriel Goetz comprehensive pamphlet Gevuras Moishe on the subject.
<h3>How to Use</h3>
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 &quot;Lakewood, NJ&quot; (the default), &quot;Vilnius, Lithuania&quot;) or just enter a zip code (Canadian or British postal codes work as well) to zoom in on your location. &nbsp; Changing to satellite view and zooming in farther will make the job easier (assuming that you can identify your roof). &nbsp; 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. &nbsp; There are two additional tabs that show today&apos;s zmanim. &nbsp; You can click on the &quot;Link&quot; button to refresh the page with the URL that contains coordinates to the currently displayed map with it&apos;s zoom level so that it can be bookmarked or emailed. <br />I would like to thank Rabbi Yehuda Herskowitz for his excellent article and additional information that he provided.
<h3>Known Issues</h3>
<h4>Google Maps API Bugs (All Fixed by Google)</h4>
<ol style="text-decoration: line-through;">
<li>Zmanim data sometimes fails to show in Firefox. This seems to be a bug the the Google Maps API when dealing with synchronous AJAX calls.</li>
<li>Locations close to 180&deg; 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 </li>
<li>Related to the above issue, sometimes the lines are drawn a &#8220;world away&#8221; and horizontal scrolling of the map is required to see the lines. Again this is a known Google Maps issue</li>
</ol>
<h4>To Do (related to Zmanim)</h4>
<ol>
<li style="text-decoration: line-through;">Support Daylight savings time (supported by the timezone webservice used, but not yet implemented in the map)</li>
<li style="text-decoration: line-through;">Link to a <a href="http://www.kosherjava.com/zmanim-project/zmanim-calendar-generator/">yearly calendar</a></li>
<li style="text-decoration: line-through;">Elevation lookup (already available in the yearly calendar)</li>
<li>Allow changing of the date</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

