<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Flight Planning</title>
	<atom:link href="http://programmingpraxis.com/2010/01/19/flight-planning/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmingpraxis.com/2010/01/19/flight-planning/</link>
	<description>A collection of etudes, updated weekly, for the education and enjoyment of the savvy programmer</description>
	<lastBuildDate>Sat, 11 Feb 2012 09:48:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Remco Niemeijer</title>
		<link>http://programmingpraxis.com/2010/01/19/flight-planning/#comment-927</link>
		<dc:creator><![CDATA[Remco Niemeijer]]></dc:creator>
		<pubDate>Tue, 19 Jan 2010 10:17:54 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1893#comment-927</guid>
		<description><![CDATA[My Haskell solution (see http://bonsaicode.wordpress.com/2010/01/19/programming-praxis-flight-planning/ for a version with comments):

[sourcecode lang=&quot;css&quot;]
import Data.Fixed

toDeg, toRad :: Floating a =&gt; a -&gt; a
toDeg d = d * 180 / pi
toRad d = d * pi / 180

navigate1 :: Float -&gt; Float -&gt; Float -&gt; Float -&gt; Float -&gt; [Int]
navigate1 d gt wn ws as = map round [gs, a, th, ft] where
    b  = toRad $ gt - wn + 180
    a  = toDeg $ asin (ws * sin b / as)
    th = mod&#039; (gt + a) 360
    gs = (cos . toRad $ th - gt) * as + ws * cos b
    ft = d / gs * 60

navigate2 :: Float -&gt; Float -&gt; Float -&gt; Float -&gt; Float -&gt; [Int]
navigate2 d gt wn ws as = if det &lt; 0 &#124;&#124; gs &lt; 0 then error &quot;strange&quot;
                          else map round [gs, a, th, ft] where
    b   = mod&#039; (gt - wn + 180) 360
    x   = ws * cos (toRad b)
    det = x^2 - ws^2 + as^2
    gs  = x + sqrt det
    a   = (if b &lt; 180 then id else negate) . toDeg . acos $
          (as^2 + gs^2 - ws^2) / (2 * gs * as)
    th  = gt + a
    ft  = d / gs * 60
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>My Haskell solution (see <a href="http://bonsaicode.wordpress.com/2010/01/19/programming-praxis-flight-planning/" rel="nofollow">http://bonsaicode.wordpress.com/2010/01/19/programming-praxis-flight-planning/</a> for a version with comments):</p>
<pre class="brush: css;">
import Data.Fixed

toDeg, toRad :: Floating a =&gt; a -&gt; a
toDeg d = d * 180 / pi
toRad d = d * pi / 180

navigate1 :: Float -&gt; Float -&gt; Float -&gt; Float -&gt; Float -&gt; [Int]
navigate1 d gt wn ws as = map round [gs, a, th, ft] where
    b  = toRad $ gt - wn + 180
    a  = toDeg $ asin (ws * sin b / as)
    th = mod' (gt + a) 360
    gs = (cos . toRad $ th - gt) * as + ws * cos b
    ft = d / gs * 60

navigate2 :: Float -&gt; Float -&gt; Float -&gt; Float -&gt; Float -&gt; [Int]
navigate2 d gt wn ws as = if det &lt; 0 || gs &lt; 0 then error &quot;strange&quot;
                          else map round [gs, a, th, ft] where
    b   = mod' (gt - wn + 180) 360
    x   = ws * cos (toRad b)
    det = x^2 - ws^2 + as^2
    gs  = x + sqrt det
    a   = (if b &lt; 180 then id else negate) . toDeg . acos $
          (as^2 + gs^2 - ws^2) / (2 * gs * as)
    th  = gt + a
    ft  = d / gs * 60
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Programming Praxis &#8211; Flight Planning &#171; Bonsai Code</title>
		<link>http://programmingpraxis.com/2010/01/19/flight-planning/#comment-926</link>
		<dc:creator><![CDATA[Programming Praxis &#8211; Flight Planning &#171; Bonsai Code]]></dc:creator>
		<pubDate>Tue, 19 Jan 2010 10:17:23 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1893#comment-926</guid>
		<description><![CDATA[[...] Praxis &#8211; Flight&#160;Planning By Remco Niemeijer  In today&#8217;s Programming Praxis exercise we have to implement two algorithms for flight [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Praxis &#8211; Flight&nbsp;Planning By Remco Niemeijer  In today&#8217;s Programming Praxis exercise we have to implement two algorithms for flight [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

