<?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/"
	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>A blog on math</title>
	<atom:link href="http://bloggingmath.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bloggingmath.wordpress.com</link>
	<description>Problem solving at it's best</description>
	<lastBuildDate>Mon, 02 Nov 2009 21:11:34 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='bloggingmath.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/9e5941b61ec5e1eb89562058b7d42366?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>A blog on math</title>
		<link>http://bloggingmath.wordpress.com</link>
	</image>
			<item>
		<title>Reasons to Keep a Blog and How to Get Beta Users</title>
		<link>http://bloggingmath.wordpress.com/2009/10/28/reasons-to-keep-a-blog-and-how-to-get-beta-users/</link>
		<comments>http://bloggingmath.wordpress.com/2009/10/28/reasons-to-keep-a-blog-and-how-to-get-beta-users/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 21:27:57 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/?p=286</guid>
		<description><![CDATA[Number one, if you like to write and I do, then it&#8217;s fun. But as Steve Yegge outlines in his post &#8220;You Should Write Blogs&#8221; it&#8217;s also good for you. I won&#8217;t repeat Steve&#8217;s points but I do want to add one point and that is a blog is a very easy way to keep [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=286&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Number one, if you like to write and I do, then it&#8217;s fun. But as Steve Yegge outlines in his post &#8220;<a href="http://steve.yegge.googlepages.com/you-should-write-blogs">You Should Write Blogs</a>&#8221; it&#8217;s also good for you. I won&#8217;t repeat Steve&#8217;s points but I do want to add one point and that is a blog is a very easy way to keep track of little tidbits of information that could otherwise be hard to refind. As an example all my posts on mono, nginx, asp.net, and asp.net mvc were written purely because I did not want have to try and find the information again or try and dredge it up from my poor memory. Instead I wrote the posts and now whenever I need to reconfigure a server to use nginx with mono and asp.net I can easily find the information on my blog. In a way it&#8217;s an extension of your memory, it&#8217;s a permanent easily searchable record of what you have done.  </p>
<p>In that spirit I&#8217;m linking to Patrick Swieskowski and Sascha Kuzins&#8217; post, <a href="http://runitback.tumblr.com/post/223371555/how-we-got-18-000-beta-users-in-4-weeks">How we got 18,000 beta users in 4 weeks</a>. Now when I need to look up how to get beta users I can simply search my blog and find this article.  </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=286&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/10/28/reasons-to-keep-a-blog-and-how-to-get-beta-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>
	</item>
		<item>
		<title>Statistically Accurate Ratings</title>
		<link>http://bloggingmath.wordpress.com/2009/10/28/statistically-accurate-ratings/</link>
		<comments>http://bloggingmath.wordpress.com/2009/10/28/statistically-accurate-ratings/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 20:54:42 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[confidence interval]]></category>
		<category><![CDATA[probability]]></category>
		<category><![CDATA[rating]]></category>
		<category><![CDATA[ratings]]></category>
		<category><![CDATA[stackoverflow]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[wilson confidence interval]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/?p=279</guid>
		<description><![CDATA[In a previous post on ratings I noted some issues with using the mean vs the media  for the rating. A few days ago Jeff Atwood posted on user ratings and specifically how to sort a set of items that are rated by users. Jeff&#8217;s post included material from Evan Miller&#8217;s article, How Not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=279&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In a previous <a href="http://bloggingmath.wordpress.com/2007/06/13/youtube-video-ratings/">post</a> on ratings I noted some issues with using the mean vs the media  for the rating. A few days ago Jeff Atwood <a href="http://blog.stackoverflow.com/2009/10/alternate-sorting-orders/">posted</a> on user ratings and specifically how to sort a set of items that are rated by users. Jeff&#8217;s post included material from Evan Miller&#8217;s article, <a href="http://www.evanmiller.org/how-not-to-sort-by-average-rating.html">How Not To Sort By Average Rating</a>, on the same subject.  </p>
<p>Below is the relevant portion of Evan Miller&#8217;s <a href="http://www.evanmiller.org/how-not-to-sort-by-average-rating.html">article</a>:</p>
<blockquote><p>
CORRECT SOLUTION: Score = Lower bound of Wilson score confidence interval for a Bernoulli parameter</p>
<p>Say what: We need to balance the proportion of positive ratings with the uncertainty of a small number of observations. Fortunately, the math for this was worked out in 1927 by Edwin B. Wilson. What we want to ask is: Given the ratings I have, there is a 95% chance that the &#8220;real&#8221; fraction of positive ratings is at least what? Wilson gives the answer. Considering only positive and negative ratings (i.e. not a 5-star scale), the lower bound on the proportion of positive ratings is given by:</p>
<p><img src="http://www.evanmiller.org/rating-equation.png" alt="wilson confidence interval formula" /></p>
<p>(For a lower bound use minus where it says plus/minus.) Here p is the observed fraction of positive ratings, zα/2 is the (1-α/2) quantile of the standard normal distribution, and n is the total number of ratings. The same formula implemented in Ruby:</p>
<p>require &#8217;statistics2&#8242;</p>
<p>def ci_lower_bound(pos, n, power)<br />
    if n == 0<br />
        return 0<br />
    end<br />
    z = Statistics2.pnormaldist(1-power/2)<br />
    phat = 1.0*pos/n<br />
    (phat + z*z/(2*n) &#8211; z * Math.sqrt((phat*(1-phat)+z*z/(4*n))/n))/(1+z*z/n)<br />
end</p>
<p>pos is the number of positive rating, n is the total number of ratings, and power refers to the statistical power: pick 0.10 to have a 95% chance that your lower bound is correct, 0.05 to have a 97.5% chance, etc.</p>
<p>Now for any item that has a bunch of positive and negative ratings, use that function to arrive at a score appropriate for sorting on, and be confident that you are using a good algorithm for doing so.
</p></blockquote>
<p>Sadly everybody has simply quoted the mathematical forumla and not even given links to the material on how to derive the formula. I was able to find an article by Keith Dunnigan <a href="www.mwsug.org/proceedings/2008/pharma/MWSUG-2008-P08.pdf">here</a> that gave an outline of how it is derived along with several other confidence intervals. Hopefully later I can take a look at my textbooks and do a full derivation. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=279&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/10/28/statistically-accurate-ratings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>

		<media:content url="http://www.evanmiller.org/rating-equation.png" medium="image">
			<media:title type="html">wilson confidence interval formula</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Auto-login Using ASP.Net FormsAuthentication</title>
		<link>http://bloggingmath.wordpress.com/2009/10/22/how-to-autologin-using-asp-net-formsauthentication/</link>
		<comments>http://bloggingmath.wordpress.com/2009/10/22/how-to-autologin-using-asp-net-formsauthentication/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 17:57:01 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Forms Authentication]]></category>
		<category><![CDATA[Membership Provider]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/2009/10/22/how-to-autologin-using-asp-net-formsauthentication/</guid>
		<description><![CDATA[For our demo website, demo.quickpm.net, I need to have a default automatic login. Using the ASP.Net Membership and FormsAuthentication an easy way to do auto-login is the following code

string userEmail = &#34;john.doe@gmail.com&#34;;
string password = &#34;thepassword&#34;;
if (Membership.ValidateUser(userEmail, password))
{
      FormsAuthentication.SetAuthCookie(userEmail, true);
      Response.Redirect(&#34;~/&#34;);
}

The above code assumes that &#8220;john.doe@gmail.com&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=269&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For our demo website, demo.quickpm.net, I need to have a default automatic login. Using the ASP.Net Membership and FormsAuthentication an easy way to do auto-login is the following code</p>
<pre class="brush: csharp;">
string userEmail = &quot;john.doe@gmail.com&quot;;
string password = &quot;thepassword&quot;;
if (Membership.ValidateUser(userEmail, password))
{
      FormsAuthentication.SetAuthCookie(userEmail, true);
      Response.Redirect(&quot;~/&quot;);
}
</pre>
<p>The above code assumes that &#8220;john.doe@gmail.com&#8221; is a user and &#8220;thepassword&#8221; is their password.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/269/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=269&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/10/22/how-to-autologin-using-asp-net-formsauthentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>
	</item>
		<item>
		<title>Mono Asp.Net MVC and Nginx</title>
		<link>http://bloggingmath.wordpress.com/2009/10/17/mono-asp-net-mvc-and-nginx/</link>
		<comments>http://bloggingmath.wordpress.com/2009/10/17/mono-asp-net-mvc-and-nginx/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 10:11:16 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/?p=259</guid>
		<description><![CDATA[I&#8217;ve been using Mono ASP.Net for a while with Nginx as the server. I recently started playing around with ASP.Net MVC and discovered that it doesn&#8217;t play nice when using Nginx as the server. To make ASP.Net work with Mono and Nginx you need to download the Mono source from here. And then modify the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=259&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been using Mono ASP.Net for a while with Nginx as the server. I recently started playing around with ASP.Net MVC and discovered that it doesn&#8217;t play nice when using Nginx as the server. To make ASP.Net work with Mono and Nginx you need to download the Mono source from <a href="http://ftp.novell.com/pub/mono/sources-stable/">here</a>. And then modify the file mcs/class/System.Web.Routing/System.Web.Routing/Route.cs<br />
in particular comment out the following lines in the GetRouteData function<br />
<code><br />
if (pathInfo != String.Empty)<br />
    throw new NotImplementedException();</code></p>
<p>If you comment out the above two lines your MVC website should work just fine when hosting it using Mono and Nginx. I don&#8217;t know if there are any negative consequences for commenting out the above two lines but I have not encountered any.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/259/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=259&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/10/17/mono-asp-net-mvc-and-nginx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick Heuristic For Tangram Polygon Intersection</title>
		<link>http://bloggingmath.wordpress.com/2009/08/30/quick-heuristic/</link>
		<comments>http://bloggingmath.wordpress.com/2009/08/30/quick-heuristic/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 08:39:39 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Computational Geometry]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[heuristic]]></category>
		<category><![CDATA[intersection]]></category>
		<category><![CDATA[polygon]]></category>
		<category><![CDATA[tangram]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/?p=245</guid>
		<description><![CDATA[For the combinatorial approach to solving Tangram puzzles one frequent operation is to test if a puzzle piece, , is contained in the silhouette . Before this test is made the puzzle piece, , is translated to a vertex, , of  and one of the edges of  is aligned with an edge,  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=245&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For the combinatorial approach to solving Tangram puzzles one frequent operation is to test if a puzzle piece, <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' />, is contained in the silhouette <img src='http://l.wordpress.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s' title='s' class='latex' />. Before this test is made the puzzle piece, <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' />, is translated to a vertex, <img src='http://l.wordpress.com/latex.php?latex=v&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v' title='v' class='latex' />, of <img src='http://l.wordpress.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s' title='s' class='latex' /> and one of the edges of <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' /> is aligned with an edge, <img src='http://l.wordpress.com/latex.php?latex=e%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e,' title='e,' class='latex' /> coming out of vertex <img src='http://l.wordpress.com/latex.php?latex=v.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v.' title='v.' class='latex' /></p>
<p>For clarity I&#8217;ve included a figure below illustrating this.</p>
<p><img src="http://lh5.ggpht.com/_Wra3MOmcwok/Spo6NVudQ8I/AAAAAAAADJg/aHMMzFFsjXg/s400/pieces%20and%20silhouette.png" alt="puzzle piece and silhouette" /></p>
<p>In the above figure it&#8217;s obvious that the puzzle piece, <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' />, does not fit in the silhouette. One way to see this computationally is to look at the edge, <img src='http://l.wordpress.com/latex.php?latex=e&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e' title='e' class='latex' />, and notice that at vertex, <img src='http://l.wordpress.com/latex.php?latex=v_1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_1' title='v_1' class='latex' />, the next edge of the silhouette, <img src='http://l.wordpress.com/latex.php?latex=s%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s,' title='s,' class='latex' /> makes a left turn with respect to the edge <img src='http://l.wordpress.com/latex.php?latex=e&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e' title='e' class='latex' />. This means that if the length of <img src='http://l.wordpress.com/latex.php?latex=e&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e' title='e' class='latex' /> is less than the length of all the edges in <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' /> then there is no possible way to fit <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' /> in <img src='http://l.wordpress.com/latex.php?latex=s.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s.' title='s.' class='latex' /> That is as long as we have the condition that one of the edges of <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' /> is aligned with the edge <img src='http://l.wordpress.com/latex.php?latex=e&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e' title='e' class='latex' /> of <img src='http://l.wordpress.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s' title='s' class='latex' />. </p>
<p>The above statement provides a quick way to skip vertices of the silhouette <img src='http://l.wordpress.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s' title='s' class='latex' /> when trying to fit the puzzle piece <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' /> in the silhouette <img src='http://l.wordpress.com/latex.php?latex=s.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s.' title='s.' class='latex' /> Of course before skipping the vertex the same test needs to be done on the other edge coming out of <img src='http://l.wordpress.com/latex.php?latex=v.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v.' title='v.' class='latex' /> Also we note that the above test only works if the next edge coming out of <img src='http://l.wordpress.com/latex.php?latex=v_1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_1' title='v_1' class='latex' /> makes a left turn with respect to the edge <img src='http://l.wordpress.com/latex.php?latex=e%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e,' title='e,' class='latex' /> otherwise the full test for polygon intersection has to be run. Also if one of the edges of the puzzle piece <img src='http://l.wordpress.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' /> has length less than or equal to the length of <img src='http://l.wordpress.com/latex.php?latex=e&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e' title='e' class='latex' /> then the full test for polygon intersection has to be run. </p>
<p>In summary this is a very specific heuristic that in general isn&#8217;t very useful but if you ever find yourself needing it, it can be just what the doctor ordered. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=245&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/08/30/quick-heuristic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>

		<media:content url="http://lh5.ggpht.com/_Wra3MOmcwok/Spo6NVudQ8I/AAAAAAAADJg/aHMMzFFsjXg/s400/pieces%20and%20silhouette.png" medium="image">
			<media:title type="html">puzzle piece and silhouette</media:title>
		</media:content>
	</item>
		<item>
		<title>A Heuristic Solution to the Tangram Puzzle</title>
		<link>http://bloggingmath.wordpress.com/2009/08/20/a-heuristic-solution-to-the-tangram-puzzle/</link>
		<comments>http://bloggingmath.wordpress.com/2009/08/20/a-heuristic-solution-to-the-tangram-puzzle/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 21:44:41 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Computational Geometry]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[heuristic]]></category>
		<category><![CDATA[tangram]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/?p=226</guid>
		<description><![CDATA[In this post I present a short summary of the paper &#8220;A Heuristic Solution to the Tangram Puzzle&#8221; by E.S. Deutsch and K. C. Hayes Jr. I&#8217;ve uploaded a scanned copy of the paper to scribd here.  Uploading the scanned copy probably violates some copyright law so if they or anyone else contacts me [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=226&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In this post I present a short summary of the paper &#8220;A Heuristic Solution to the Tangram Puzzle&#8221; by E.S. Deutsch and K. C. Hayes Jr. I&#8217;ve uploaded a scanned copy of the paper to scribd <a href="http://www.scribd.com/doc/16369155/A-Heuristic-Solution-to-the-Tangram-Puzzle">here.</a>  Uploading the scanned copy probably violates some copyright law so if they or anyone else contacts me I&#8217;ll remove the document. Ironically it&#8217;s taken me over two-years since my post <a href="http://bloggingmath.wordpress.com/2007/05/28/tangram-puzzle/">here</a> to finally read the paper.</p>
<p>In their paper they talk about two possible approaches to solving tangrams. One is the combinatorial approach that I&#8217;ve taken and the other is the heuristic method that they describe in their paper. The heuristic method that they use is a little clever, what they do is take the outline of the tangram puzzle and then try to break it out into sub-puzzles. The following figure illustrates where two puzzles have both been separated out into sub-puzzles. In both cases one of the sub-puzzles exactly matches a tangram piece thus allowing the algorithm to solve that sub-puzzle. </p>
<p><img src="http://lh3.ggpht.com/_Wra3MOmcwok/So21bUTkPfI/AAAAAAAADIk/Ut02SwOCLzo/s800/subpuzzlessvg.png" alt="Puzzle Illustration" /></p>
<p>The dashed lines in the figure show where the algorithm is splitting the sub-puzzles out from the original puzzle. First note that the dashed lines are called &#8220;extension lines&#8221; in the paper. They are generated to allow the extraction of the sub-puzzles. To create the extension lines the algorithm goes along the outline of the puzzle and at convex corners it generates an &#8220;extension line&#8221; that allows the possible separation of the puzzle into sub-puzzles. The following figure illustrates this. In the paper they outline various ways for eliminating extension lines that are unlikely to be of use.</p>
<p><img src="http://lh6.ggpht.com/_Wra3MOmcwok/So2-FZvXZZI/AAAAAAAADIs/J4g0ir6mhm8/s800/extensionlines.png" alt="Extension Lines" /></p>
<p>Once the above extension lines are created there is a set of heuristics for splitting out sub-puzzles, the heuristics are used in the following order. </p>
<p><strong><br />
1. direct-match rule</strong><br />
The algorithm attempts to locate puzzle pieces <i>fully described by edges</i>, rather than by extension lines or by combinations of edges and extension lines. </p>
<p><strong>2. 2 1/2 &#8211; 3 1/2 edge-match rule</strong><br />
The direct-match rule while being very reliable in finding matches cannot be used in most cases this means that a more relaxed rule is needed. The 2 1/2 &#8211; 3 1/2 edge-match rule allows the location of puzzle pieces where most of the periphery is described by edges and a small portion is described by extension lines. Specifically the &#8220;2 1/2 &#8211; 3 1/2 edge-match rules requires that in the case of triangular shapes <i>two complete sides must be defined by edges and the remaining side can be defined by a combination of collinear edges and extension lines. Moreover, the combination must include at least one portion of edge. For four sided puzzle pieces the rule requires that the additional side also be fully described by an edge.</i>&#8221; [1]</p>
<p>There are an additional 8 extraction rules that are used but the above two give you their general flavor.</p>
<p>The organization of the extraction rules is to run them recursively and at each step try to apply the most specific one possible first. If the algorithm gets to a step where there are no possible extractions it backtracks and tries another extraction rule. This process is not guaranteed to find a solution and in fact the paper gives an example of a puzzle on page 239 for which no solution is found.  </p>
<p>The paper is a niece example of where a little clever thinking and some very specific heuristics can solve tangram puzzles.<br />
<strong><br />
References </strong></p>
<p>[1] Deutsch, E. S., and K. C. Hayes Jr. &#8220;A Heuristic Solution to the Tangram Puzzle&#8221;, <a href="http://www.doc.ic.ac.uk/~shm/MI/mi7.html">Machine Intelligence vol. 7</a>, 1972, p. 205–240. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=226&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/08/20/a-heuristic-solution-to-the-tangram-puzzle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>

		<media:content url="http://lh3.ggpht.com/_Wra3MOmcwok/So21bUTkPfI/AAAAAAAADIk/Ut02SwOCLzo/s800/subpuzzlessvg.png" medium="image">
			<media:title type="html">Puzzle Illustration</media:title>
		</media:content>

		<media:content url="http://lh6.ggpht.com/_Wra3MOmcwok/So2-FZvXZZI/AAAAAAAADIs/J4g0ir6mhm8/s800/extensionlines.png" medium="image">
			<media:title type="html">Extension Lines</media:title>
		</media:content>
	</item>
		<item>
		<title>Convex Hulls</title>
		<link>http://bloggingmath.wordpress.com/2009/06/04/convex-hulls/</link>
		<comments>http://bloggingmath.wordpress.com/2009/06/04/convex-hulls/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 18:17:29 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Computational Geometry]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[2d convex hull]]></category>
		<category><![CDATA[convex hull]]></category>
		<category><![CDATA[html5 canvas]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/?p=207</guid>
		<description><![CDATA[The algorithm I&#8217;m going to showcase is taken from the book &#8220;Computational Geometry algorithms and applications&#8221; by Berg, Cheong, Kreveld, and Overmars. They give an excellent analysis of the algorithm in the book so I&#8217;ll only go over the highlights and show my implementation in Javascript using the html5 canvas.
The problem statement is given a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=207&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The algorithm I&#8217;m going to showcase is taken from the book &#8220;<a href="http://books.google.com/books?id=tkyG8W2163YC">Computational Geometry algorithms and applications</a>&#8221; by Berg, Cheong, Kreveld, and Overmars. They give an excellent analysis of the algorithm in the book so I&#8217;ll only go over the highlights and show my implementation in Javascript using the html5 canvas.</p>
<p>The problem statement is given a set of points, <img src='http://l.wordpress.com/latex.php?latex=S+%3D+%5C%7Bp_1%2C+p_2%2C+%5Cldots%2C+p_n%5C%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='S = \{p_1, p_2, \ldots, p_n\}' title='S = \{p_1, p_2, \ldots, p_n\}' class='latex' />  in <img src='http://l.wordpress.com/latex.php?latex=R%5E2&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='R^2' title='R^2' class='latex' /> compute the <a href="http://en.wikipedia.org/wiki/Convex_hull">convex hull</a> of S. The input of the algorithm is the set, <img src='http://l.wordpress.com/latex.php?latex=S&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='S' title='S' class='latex' />, of points and the output of the algorithm is the set of points that are the vertices of the convex hull of <img src='http://l.wordpress.com/latex.php?latex=S.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='S.' title='S.' class='latex' /> </p>
<p>Our algorithm will use a standard design technique to generate what&#8217;s called an <i>incremental algorithm</i>. That is we compute the solution for the first <img src='http://l.wordpress.com/latex.php?latex=p_1%2C+%5Cldots%2C+p_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_1, \ldots, p_i' title='p_1, \ldots, p_i' class='latex' /> points then add the point <img src='http://l.wordpress.com/latex.php?latex=p_%7Bi%2B1%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_{i+1}' title='p_{i+1}' class='latex' /> and compute the new solution using the previous solution.</p>
<p><strong>Algorithm ConvexHull(P)</strong> (the pseudocode is borrowed from &#8220;Computational Geometry algorithms and applications&#8221;)<br />
Input. A set P of points in the plane<br />
Output. A list containing the vertices of <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BCH%7D%28P%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{CH}(P)' title='\mathcal{CH}(P)' class='latex' /> in clockwise order.<br />
1. Sort the points by x-coordinate, resulting in a sequence <img src='http://l.wordpress.com/latex.php?latex=p_1%2C%5Cldots%2C+p_n.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_1,\ldots, p_n.' title='p_1,\ldots, p_n.' class='latex' /><br />
2. Put the points <img src='http://l.wordpress.com/latex.php?latex=p_1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_1' title='p_1' class='latex' /> and <img src='http://l.wordpress.com/latex.php?latex=p_2&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_2' title='p_2' class='latex' /> in a list <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Bupper%7D%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{upper},' title='\mathcal{L}_\textrm{upper},' class='latex' /> with <img src='http://l.wordpress.com/latex.php?latex=p_1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_1' title='p_1' class='latex' /> as the first point.<br />
3. <b>for</b> <img src='http://l.wordpress.com/latex.php?latex=i+%5Cleftarrow+3&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='i \leftarrow 3' title='i \leftarrow 3' class='latex' /> <b>to</b> <img src='http://l.wordpress.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='n' title='n' class='latex' /><br />
4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>do</b> Append <img src='http://l.wordpress.com/latex.php?latex=p_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_i' title='p_i' class='latex' /> to <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Bupper%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{upper}.' title='\mathcal{L}_\textrm{upper}.' class='latex' /><br />
5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<b>while</b> <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Bupper%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{upper}' title='\mathcal{L}_\textrm{upper}' class='latex' /> contains more than two points <b>and</b> the last three points in <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Bupper%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{upper}' title='\mathcal{L}_\textrm{upper}' class='latex' /> do not make a right turn<br />
6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;            <b>do</b> Delete the middle of the last three points from <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Bupper%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{upper}.' title='\mathcal{L}_\textrm{upper}.' class='latex' /><br />
7. Put the points <img src='http://l.wordpress.com/latex.php?latex=p_n&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_n' title='p_n' class='latex' /> and <img src='http://l.wordpress.com/latex.php?latex=p_%7Bn-1%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_{n-1}' title='p_{n-1}' class='latex' /> in a list <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Blower%7D%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{lower},' title='\mathcal{L}_\textrm{lower},' class='latex' /> with <img src='http://l.wordpress.com/latex.php?latex=p_n&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_n' title='p_n' class='latex' /> as the first point.<br />
8.&nbsp;<b>for</b> <img src='http://l.wordpress.com/latex.php?latex=i+%5Cleftarrow+n+-2&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='i \leftarrow n -2' title='i \leftarrow n -2' class='latex' /> <b> downto</b> 1<br />
9.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>do</b> Append <img src='http://l.wordpress.com/latex.php?latex=p_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_i' title='p_i' class='latex' /> to <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Blower%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{lower}.' title='\mathcal{L}_\textrm{lower}.' class='latex' /><br />
10.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>while</b> <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Blower%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{lower}' title='\mathcal{L}_\textrm{lower}' class='latex' /> contains more than 2 points <b>and</b> the last three points in <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Blower%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{lower}' title='\mathcal{L}_\textrm{lower}' class='latex' /> do not make a right turn<br />
11.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>do</b> Delete the middle of the last three points from <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Blower%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{lower}.' title='\mathcal{L}_\textrm{lower}.' class='latex' /><br />
12. Remove the first and last point from <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Blower%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{lower}.' title='\mathcal{L}_\textrm{lower}.' class='latex' /> to ovoid duplication of the points where the upper and lower hull meet.<br />
13. Append <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Blower%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{lower}' title='\mathcal{L}_\textrm{lower}' class='latex' /> to <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D_%5Ctextrm%7Bupper%7D%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}_\textrm{upper},' title='\mathcal{L}_\textrm{upper},' class='latex' /> and call the resulting list <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}.' title='\mathcal{L}.' class='latex' /><br />
14. <b>return</b> <img src='http://l.wordpress.com/latex.php?latex=%5Cmathcal%7BL%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathcal{L}.' title='\mathcal{L}.' class='latex' /></p>
<p>You can view an implementation using Javascript and the html5 canvas element, <a href="http://cloud.github.com/downloads/bjwbell/canvas-geolib/hull2.html">here</a>.  To add a new point simply click the left mouse button and it&#8217;ll add a point where the mouse is.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/207/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=207&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/06/04/convex-hulls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>
	</item>
		<item>
		<title>Right and Left Turns</title>
		<link>http://bloggingmath.wordpress.com/2009/06/03/right-and-left-turns/</link>
		<comments>http://bloggingmath.wordpress.com/2009/06/03/right-and-left-turns/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 01:15:07 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Computational Geometry]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[line segment]]></category>
		<category><![CDATA[line segment turns]]></category>
		<category><![CDATA[points]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/?p=184</guid>
		<description><![CDATA[In my previous post on line segment intersection I introduced the two dimensional cross product as  The cross product can also be used to determine if a set of three points  make a right turn. 
First note that if  then the angle between  and  is strictly less than  For [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=184&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In my previous post on line segment intersection I introduced the two dimensional cross product as <img src='http://l.wordpress.com/latex.php?latex=v1+%5Ctimes+v2+%3D+%7Bv1%7D_x+%5Ccdot+%7Bv2%7D_y+-+%7Bv2%7D_x+%5Ccdot+%7Bv1%7D_y.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v1 \times v2 = {v1}_x \cdot {v2}_y - {v2}_x \cdot {v1}_y.' title='v1 \times v2 = {v1}_x \cdot {v2}_y - {v2}_x \cdot {v1}_y.' class='latex' /> The cross product can also be used to determine if a set of three points <img src='http://l.wordpress.com/latex.php?latex=p_1%2C+p_2%2C+%5Ctextrm%7B+and+%7D+p_3&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_1, p_2, \textrm{ and } p_3' title='p_1, p_2, \textrm{ and } p_3' class='latex' /> make a right turn. </p>
<p>First note that if <img src='http://l.wordpress.com/latex.php?latex=v_1+%5Ctimes+v_2+%3E+0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_1 \times v_2 &gt; 0' title='v_1 \times v_2 &gt; 0' class='latex' /> then the angle between <img src='http://l.wordpress.com/latex.php?latex=v_1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_1' title='v_1' class='latex' /> and <img src='http://l.wordpress.com/latex.php?latex=v_2&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_2' title='v_2' class='latex' /> is strictly less than <img src='http://l.wordpress.com/latex.php?latex=%5Cpi.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\pi.' title='\pi.' class='latex' /> For example the two vectors <img src='http://l.wordpress.com/latex.php?latex=%281%2C+0%29+%5Ctimes+%280%2C+1%29+%3D+1+%5Ccdot+1+-+0+%3D+1+%3E+0.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='(1, 0) \times (0, 1) = 1 \cdot 1 - 0 = 1 &gt; 0.' title='(1, 0) \times (0, 1) = 1 \cdot 1 - 0 = 1 &gt; 0.' class='latex' /> Similarly if <img src='http://l.wordpress.com/latex.php?latex=v_1+%5Ctimes+v_2+%3C+0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_1 \times v_2 &lt; 0' title='v_1 \times v_2 &lt; 0' class='latex' /> then the angle between them is strictly greater than <img src='http://l.wordpress.com/latex.php?latex=%5Cpi.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\pi.' title='\pi.' class='latex' />  In the below image I&#39;ve shown an example where the three points <img src='http://l.wordpress.com/latex.php?latex=p_1%2C+p_2%2C+%5Ctextrm%7B+and+%7D+p_3+&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_1, p_2, \textrm{ and } p_3 ' title='p_1, p_2, \textrm{ and } p_3 ' class='latex' /> make a right turn. </p>
<p><img src="http://lh3.ggpht.com/_Wra3MOmcwok/SiWuy8PC6lI/AAAAAAAACbk/jmt2lwWCI48/s288/RightTurn.png" alt="Points p1, p2, p3 making a right turn" /></p>
<p>To mathematically determine if the points make a right turn we let <img src='http://l.wordpress.com/latex.php?latex=v_1+%3D+p_1+-+p_2+%5Ctextrm%7B+and+%7D+v_2+%3D+p_3+-+p_2.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_1 = p_1 - p_2 \textrm{ and } v_2 = p_3 - p_2.' title='v_1 = p_1 - p_2 \textrm{ and } v_2 = p_3 - p_2.' class='latex' />  Then taking the cross product of <img src='http://l.wordpress.com/latex.php?latex=v_1+%5Ctextrm%7B+and+%7D+v_2%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_1 \textrm{ and } v_2,' title='v_1 \textrm{ and } v_2,' class='latex' /> we have <img src='http://l.wordpress.com/latex.php?latex=v_1+%5Ctimes+v_2+%3E+0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='v_1 \times v_2 &gt; 0' title='v_1 \times v_2 &gt; 0' class='latex' /> which implies that the angle between them is less than <img src='http://l.wordpress.com/latex.php?latex=%5Cpi&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\pi' title='\pi' class='latex' /> that is they make a right turn.</p>
<p>This method for determining whether the points make a right or left turn is very useful for determining the convex hull of a set of points.</p>
<p>I&#8217;ve posted an example webpage, <a href="http://cloud.github.com/downloads/bjwbell/canvas-geolib/turn.html">here</a>, where using javascript the lines change color depending on whether the turn is to the right or the left. Please note that the page uses the html5 canvas element so it will not work in internet explorer 7, or 6.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=184&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/06/03/right-and-left-turns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>

		<media:content url="http://lh3.ggpht.com/_Wra3MOmcwok/SiWuy8PC6lI/AAAAAAAACbk/jmt2lwWCI48/s288/RightTurn.png" medium="image">
			<media:title type="html">Points p1, p2, p3 making a right turn</media:title>
		</media:content>
	</item>
		<item>
		<title>Line Segment Intersection</title>
		<link>http://bloggingmath.wordpress.com/2009/05/29/line-segment-intersection/</link>
		<comments>http://bloggingmath.wordpress.com/2009/05/29/line-segment-intersection/#comments</comments>
		<pubDate>Fri, 29 May 2009 21:45:45 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Computational Geometry]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 canvas]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[line intersection]]></category>
		<category><![CDATA[line segment intersection]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/?p=140</guid>
		<description><![CDATA[We want to determine if two line segments  and  intersect and if they do intersect, the point of intersection. First we want to analyze the problem. There is an edge case that is difficult to analyze (case 5 in the below list).

 The segments are not parallel (easy) 
 The segments are parallel [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=140&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We want to determine if two line segments <img src='http://l.wordpress.com/latex.php?latex=s_1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s_1' title='s_1' class='latex' /> and <img src='http://l.wordpress.com/latex.php?latex=s_2&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s_2' title='s_2' class='latex' /> intersect and if they do intersect, the point of intersection. First we want to analyze the problem. There is an edge case that is difficult to analyze (case 5 in the below list).</p>
<ol>
<li> The segments are not parallel (easy) </li>
<li> The segments are parallel and do not intersect  (easy)</li>
<li> The segments are <a href="http://en.wikipedia.org/wiki/Collinear">collinear</a> and do not intersect (easy) </li>
<li> The segments are collinear and do intersect (easy) </li>
<li> The segments are nearly parallel or nearly collinear (hard)</li>
</ol>
<p>In this post I handle cases 1 through 4. I&#8217;ll leave the handling of case 5 for later posts.</p>
<p>For the problem setup let segment 1 be given by
<p>
<img src='http://l.wordpress.com/latex.php?latex=s_1+%3D+p+%2B+t+%5Ccdot+r&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s_1 = p + t \cdot r' title='s_1 = p + t \cdot r' class='latex' /> where <img src='http://l.wordpress.com/latex.php?latex=0+%3C%3D+t+%3C%3D+1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='0 &lt;= t &lt;= 1' title='0 &lt;= t &lt;= 1' class='latex' /> and p, r are 2d vectors, similarly let segment 2 be given by </p>
<p>
<img src='http://l.wordpress.com/latex.php?latex=s_2+%3D+q+%2B+u+%5Ccdot+s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s_2 = q + u \cdot s' title='s_2 = q + u \cdot s' class='latex' /> where <img src='http://l.wordpress.com/latex.php?latex=0+%3C%3D+u+%3C%3D+1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='0 &lt;= u &lt;= 1' title='0 &lt;= u &lt;= 1' class='latex' /> and q, s are 2d vectors.
<p>This representation of the line segments yields a very natural method for computing their intersection.</p>
<p>Computing cross products is the heart of the algorithm for determining intersections. The two dimensional <a href="http://en.wikipedia.org/wiki/Cross_product">cross product</a> of <img src='http://l.wordpress.com/latex.php?latex=p_1+%5Ctimes+p_2&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_1 \times p_2' title='p_1 \times p_2' class='latex' /> is given by </p>
<p>
<img src='http://l.wordpress.com/latex.php?latex=%5Ctextrm%7Bdet%7D+%5Cleft%28+%5Cbegin%7Barray%7D+%7Bcc%7D+x_1+%26+x_2+%5C%5C+y_1+%26+y_2%5Cend%7Barray%7D+%5Cright%29+%3D+x_1y_2+-+x_2y_1+%3D+-p_2+%5Ctimes+p_1+&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\textrm{det} \left( \begin{array} {cc} x_1 &amp; x_2 \\ y_1 &amp; y_2\end{array} \right) = x_1y_2 - x_2y_1 = -p_2 \times p_1 ' title='\textrm{det} \left( \begin{array} {cc} x_1 &amp; x_2 \\ y_1 &amp; y_2\end{array} \right) = x_1y_2 - x_2y_1 = -p_2 \times p_1 ' class='latex' /></p>
<p>If the cross product is zero then the two vectors are collinear that is pointing in either same direction or opposite directions.</p>
<p>The two lines intersect when <img src='http://l.wordpress.com/latex.php?latex=p+%2B+t++%5Ccdot+r+%3D+q+%2B+u+%5Ccdot+s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p + t  \cdot r = q + u \cdot s' title='p + t  \cdot r = q + u \cdot s' class='latex' />, by crossing both sides with <img src='http://l.wordpress.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s' title='s' class='latex' /> we get</p>
<p><img src='http://l.wordpress.com/latex.php?latex=%28p+%2B+t+%5Ccdot+r%29+%5Ctimes+s+%3D+%28q+%2B+u+%5Ccdot+s%29+%5Ctimes+s+%3D+q+%5Ctimes+s+%2B+u+%5Ccdot+s+%5Ctimes+s+%3D+q+%5Ctimes+s.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='(p + t \cdot r) \times s = (q + u \cdot s) \times s = q \times s + u \cdot s \times s = q \times s.' title='(p + t \cdot r) \times s = (q + u \cdot s) \times s = q \times s + u \cdot s \times s = q \times s.' class='latex' />
<p>From this we solve for <img src='http://l.wordpress.com/latex.php?latex=t&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='t' title='t' class='latex' /> obtaining
<p> <img src='http://l.wordpress.com/latex.php?latex=t+%3D+%5Cfrac%7B%28q+-+p%29+%5Ctimes+s%7D%7Br+%5Ctimes+s%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='t = \frac{(q - p) \times s}{r \times s}.' title='t = \frac{(q - p) \times s}{r \times s}.' class='latex' /></p>
<p>We can similarly solve for <img src='http://l.wordpress.com/latex.php?latex=u&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='u' title='u' class='latex' />, obtaining
<p> <img src='http://l.wordpress.com/latex.php?latex=u+%3D+%5Cfrac%7B%28q+-p%29+%5Ctimes+r%7D%7Br+%5Ctimes+s%7D.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='u = \frac{(q -p) \times r}{r \times s}.' title='u = \frac{(q -p) \times r}{r \times s}.' class='latex' /></p>
<p> If both t and u are between 0 and 1, then the two line segments intersect and the intersection point is given by <img src='http://l.wordpress.com/latex.php?latex=p+%2B+t+%5Ccdot+r%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p + t \cdot r,' title='p + t \cdot r,' class='latex' /> where the value of t is the one we solved for. If either t or u are not between 0 and 1 then the line segments do not intersect. </p>
<p>But suppose <img src='http://l.wordpress.com/latex.php?latex=r+%5Ctimes+s+%3D+0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r \times s = 0' title='r \times s = 0' class='latex' />, then we can&#8217;t solve for t and u. This is because <img src='http://l.wordpress.com/latex.php?latex=r+%5Ctimes+s+%3D+0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r \times s = 0' title='r \times s = 0' class='latex' /> means that r and s are parallel which means the two line segments are parallel. Please also note that <img src='http://l.wordpress.com/latex.php?latex=r+%5Ctimes+s+%3D+0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r \times s = 0' title='r \times s = 0' class='latex' /> implies that <img src='http://l.wordpress.com/latex.php?latex=r&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r' title='r' class='latex' /> and <img src='http://l.wordpress.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s' title='s' class='latex' /> are scalar multiplies of each other. If <img src='http://l.wordpress.com/latex.php?latex=%28p+-q%29+%5Ctimes+r+%5Cnot%3D+0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='(p -q) \times r \not= 0' title='(p -q) \times r \not= 0' class='latex' /> then the segments are parallel but not collinear hence they do not intersect. If <img src='http://l.wordpress.com/latex.php?latex=%28p+-q%29+%5Ctimes+r+%3D+0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='(p -q) \times r = 0' title='(p -q) \times r = 0' class='latex' /> then the segments are collinear and we can simply project both of them onto to x-axis and determine if their projections intersect.</p>
<p>For case 5 when <img src='http://l.wordpress.com/latex.php?latex=r+%5Ctimes+s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r \times s' title='r \times s' class='latex' /> is close to zero the analysis needs to be well thought out and I&#8217;ll leave it to future posts.</p>
<p>I&#8217;ve posted a sample implementation in Javascript using the html5 canvas at <a href="http://cloud.github.com/downloads/bjwbell/canvas-geolib/main.html">http://cloud.github.com/downloads/bjwbell/canvas-geolib/main.html </a>(please note it won&#8217;t work in internet explorer since it doesn&#8217;t support the canvas element).</p>
<p>Credit Gareth Rees for his <a href="http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect/565282#565282">post</a> at stackoverflow.com which is based on the method for 3D line intersection algorithm from the article &#8220;Intersection of two lines in three-space&#8221; by Ronald Graham, published in Graphics Gems, page 304. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=140&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/05/29/line-segment-intersection/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>
	</item>
		<item>
		<title>Book Memes</title>
		<link>http://bloggingmath.wordpress.com/2009/05/18/book-memes/</link>
		<comments>http://bloggingmath.wordpress.com/2009/05/18/book-memes/#comments</comments>
		<pubDate>Mon, 18 May 2009 22:53:23 +0000</pubDate>
		<dc:creator>Bryan Bell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[book memes]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[fibonacci]]></category>
		<category><![CDATA[fibonacci numbers]]></category>
		<category><![CDATA[meme]]></category>
		<category><![CDATA[memes]]></category>

		<guid isPermaLink="false">http://bloggingmath.wordpress.com/2009/05/18/book-memes/</guid>
		<description><![CDATA[Book memes
* Grab the nearest book.
* Open it to page 56.
* Find the fifth sentence.
* Post the text of the sentence in your journal along with these instructions.
* Don&#8217;t dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.
&#8220;Fibonacci numbers are related to the golden ratio phi and to its [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=136&subd=bloggingmath&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Book memes<br />
* Grab the nearest book.<br />
* Open it to page 56.<br />
* Find the fifth sentence.<br />
* Post the text of the sentence in your journal along with these instructions.<br />
* Don&#8217;t dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.</p>
<p>&#8220;Fibonacci numbers are related to the golden ratio phi and to its conjugate, which are given by the following formulas: phi = (1+sqrt(5))/2, conjugate phi = (1 &#8211; sqrt(5))/2&#8243;</p>
<p>I&#8217;m way too geeky <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  most of my books are mathematics and computer science. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bloggingmath.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bloggingmath.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bloggingmath.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bloggingmath.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bloggingmath.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bloggingmath.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bloggingmath.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bloggingmath.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bloggingmath.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bloggingmath.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bloggingmath.wordpress.com&blog=354208&post=136&subd=bloggingmath&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bloggingmath.wordpress.com/2009/05/18/book-memes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/01bd809fb0f4b9d644bf9e956fb14ba9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bjwbell</media:title>
		</media:content>
	</item>
	</channel>
</rss>