<?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/"
		>
<channel>
	<title>Comments on: Fun with Math</title>
	<atom:link href="http://pathfindersoftware.com/2009/04/fun-with-math/feed/" rel="self" type="application/rss+xml" />
	<link>http://pathfindersoftware.com/2009/04/fun-with-math/</link>
	<description>The Fastest Way to Launch Successful Software</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:36:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: marocchino</title>
		<link>http://pathfindersoftware.com/2009/04/fun-with-math/#comment-9437</link>
		<dc:creator>marocchino</dc:creator>
		<pubDate>Sat, 02 May 2009 01:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2237#comment-9437</guid>
		<description>how about this?

def diff_deg(a,b)
  (diff=(a-b).abs)&gt;180&amp;&amp;360-diff&#124;&#124;diff
end</description>
		<content:encoded><![CDATA[<p>how about this?</p>
<p>def diff_deg(a,b)<br />
  (diff=(a-b).abs)&gt;180&amp;&amp;360-diff||diff<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Neighbors</title>
		<link>http://pathfindersoftware.com/2009/04/fun-with-math/#comment-9436</link>
		<dc:creator>Derek Neighbors</dc:creator>
		<pubDate>Wed, 29 Apr 2009 15:54:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2237#comment-9436</guid>
		<description>Math can be fun.  I would love to see the Objective-C test and the Objective-C code to compare.</description>
		<content:encoded><![CDATA[<p>Math can be fun.  I would love to see the Objective-C test and the Objective-C code to compare.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Buchek</title>
		<link>http://pathfindersoftware.com/2009/04/fun-with-math/#comment-9435</link>
		<dc:creator>Craig Buchek</dc:creator>
		<pubDate>Wed, 29 Apr 2009 15:13:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2237#comment-9435</guid>
		<description>I don&#039;t see any reason to convert to radians and back to degrees. The code would be a lot simpler if you didn&#039;t:

def diff_deg(a,b)
  dif = ((a % 360) - (b % 360)).abs
  dif = 360 - dif if dif &gt; 180
  dif
end</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see any reason to convert to radians and back to degrees. The code would be a lot simpler if you didn&#8217;t:</p>
<p>def diff_deg(a,b)<br />
  dif = ((a % 360) &#8211; (b % 360)).abs<br />
  dif = 360 &#8211; dif if dif &gt; 180<br />
  dif<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Tooke</title>
		<link>http://pathfindersoftware.com/2009/04/fun-with-math/#comment-9434</link>
		<dc:creator>Steve Tooke</dc:creator>
		<pubDate>Wed, 29 Apr 2009 14:06:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2237#comment-9434</guid>
		<description>You don&#039;t need to convert to radians and back to use the same result:

http://gist.github.com/103790</description>
		<content:encoded><![CDATA[<p>You don&#8217;t need to convert to radians and back to use the same result:</p>
<p><a href="http://gist.github.com/103790" rel="nofollow">http://gist.github.com/103790</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mathfan</title>
		<link>http://pathfindersoftware.com/2009/04/fun-with-math/#comment-9433</link>
		<dc:creator>mathfan</dc:creator>
		<pubDate>Wed, 29 Apr 2009 11:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2237#comment-9433</guid>
		<description>Let thita = abs(thita1 - thita2)
answer = min{thita, 360 - thita}</description>
		<content:encoded><![CDATA[<p>Let thita = abs(thita1 &#8211; thita2)<br />
answer = min{thita, 360 &#8211; thita}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shalom Craimer</title>
		<link>http://pathfindersoftware.com/2009/04/fun-with-math/#comment-9432</link>
		<dc:creator>Shalom Craimer</dc:creator>
		<pubDate>Wed, 29 Apr 2009 11:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2237#comment-9432</guid>
		<description>I don&#039;t feel there was any need for converting it to radians... You just want to figure out the difference and constrain it to be below 180!

def diff_deg(a,b)
  #adjust for zero
  a = 360 if a == 0
  b = 360 if b == 0

  dif = (a-b).abs

  # constrain to the shortest path, so trim if it&#039;s &gt; 180°
  dif = (dif &gt; 180) ? (360-dif) : dif
end</description>
		<content:encoded><![CDATA[<p>I don&#8217;t feel there was any need for converting it to radians&#8230; You just want to figure out the difference and constrain it to be below 180!</p>
<p>def diff_deg(a,b)<br />
  #adjust for zero<br />
  a = 360 if a == 0<br />
  b = 360 if b == 0</p>
<p>  dif = (a-b).abs</p>
<p>  # constrain to the shortest path, so trim if it&#8217;s &gt; 180°<br />
  dif = (dif &gt; 180) ? (360-dif) : dif<br />
end</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (User agent is rejected)
Page Caching using memcached (User agent is rejected)

Served from: pathfindersoftware.com @ 2012-02-09 20:03:54 -->
