<?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>Greg Klein&#039;s Blog</title>
	<atom:link href="http://gregklein.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregklein.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 08 Apr 2013 22:37:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='gregklein.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/ea338fe631d1bed631e3d63761349861?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Greg Klein&#039;s Blog</title>
		<link>http://gregklein.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gregklein.wordpress.com/osd.xml" title="Greg Klein&#039;s Blog" />
	<atom:link rel='hub' href='http://gregklein.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Wikipedia, Python, and Maps</title>
		<link>http://gregklein.wordpress.com/2013/03/19/wikipedia-python-and-maps/</link>
		<comments>http://gregklein.wordpress.com/2013/03/19/wikipedia-python-and-maps/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 23:06:36 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=321</guid>
		<description><![CDATA[Wikipedia is very cool. As of this post (March 19th), the English language wikipedia has about 4.2 million articles written by volunteers. Of these, a little under 1.5 million have geographical information associated with them in the form of geographical coordinates. For example, on the article about UCSC if you look in the upper right hand [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=321&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Wikipedia is very cool. As of this post (March 19th), the English language wikipedia has about 4.2 million articles written by volunteers. Of these, a little under 1.5 million have geographical information associated with them in the form of geographical coordinates. For example, on the <a href="http://en.wikipedia.org/wiki/University_of_California,_Santa_Cruz">article about UCSC</a> if you look in the upper right hand corner, you&#8217;ll see a small bit of text displaying the geographical coordinates. There&#8217;s a <a href="http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Geographical_coordinates">whole group of people</a> on wikipedia dedicated to adding this information to articles. And they&#8217;ve done a great job.</p>
<p>I happened to stumble upon a very useful data dump created by someone with the account name &#8220;<a href="http://toolserver.org/~dispenser/view/Main_Page">dispenser</a>&#8221; on the <a href="http://toolserver.org/">wikimedia toolserver</a>. It is a .sql file of all of the geotagged articles in the english language wikipedia (find it <a href="http://toolserver.org/~dispenser/dumps/coord_enwiki.sql.gz">here</a>).</p>
<p>So I dumped this file into a mysql database on my computer, and sure enough, I&#8217;m able to make queries and get geographical information out!</p>
<pre class="brush: plain; title: ; notranslate">

mysql&gt; select gc_lat, gc_lon, gc_name from coord_enwiki where gc_name = &quot;University of California, Santa Cruz&quot;;
+-------------+---------------+--------------------------------------+
| gc_lat      | gc_lon        | gc_name                              |
+-------------+---------------+--------------------------------------+
| 37.00000000 | -122.06000000 | University of California, Santa Cruz |
+-------------+---------------+--------------------------------------+
1 row in set (0.43 sec)

</pre>
<p>So the next step I thought would be neat was to display all of the geotagged wikipedia articles near where I live (<a href="http://en.wikipedia.org/wiki/Santa_Cruz,_California">Santa Cruz, California</a>). I chose to use Python because it&#8217;s pretty well suited for simple hacks like this, and I can always use the practice. Interfacing Python with MySQL is easy enough using the <a href="http://mysql-python.sourceforge.net/">MySQLdb package</a>, but we have another problem: how to create maps easily in Python. After a very short amount of time searching, I found the answer: <a href="http://matplotlib.org/basemap/">basemap</a>.</p>
<p>Basemap makes drawing all sorts of maps in all sorts of projections super simple. So with these tools in hand, I was able to quickly create the following map:</p>
<div id="attachment_327" class="wp-caption aligncenter" style="width: 515px"><a href="http://gregklein.files.wordpress.com/2013/03/wikipedia_santacruzarea.png"><img class=" wp-image-327 " alt="All geotagged articles near Santa Cruz, CA." src="http://gregklein.files.wordpress.com/2013/03/wikipedia_santacruzarea.png?w=505" width="505" /></a><p class="wp-caption-text">All geotagged articles near Santa Cruz, CA.</p></div>
<p>Neat! So the next step for me was to try to produce a global map of wikipedia articles. After some experimentation, I found that using a heatmap would work much better than placing points, as the denser parts of the map just end up black, which isn&#8217;t very useful.</p>
<p>So after a bit more work I&#8217;m left with this:</p>
<div id="attachment_328" class="wp-caption aligncenter" style="width: 515px"><a href="http://gregklein.files.wordpress.com/2013/03/worldheatmap.png"><img class=" wp-image-328 " alt="Global view of English Wikipedia articles." src="http://gregklein.files.wordpress.com/2013/03/worldheatmap.png?w=505" width="505" /></a><p class="wp-caption-text">Global view of English Wikipedia articles.</p></div>
<p>I&#8217;ve posted all of the sourcecode to make the heatmap above, you can find it <a href="http://greg.hibal.org/code/plot.txt">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/321/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=321&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2013/03/19/wikipedia-python-and-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2013/03/wikipedia_santacruzarea.png" medium="image">
			<media:title type="html">All geotagged articles near Santa Cruz, CA.</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2013/03/worldheatmap.png?w=700" medium="image">
			<media:title type="html">Global view of English Wikipedia articles.</media:title>
		</media:content>
	</item>
		<item>
		<title>Chess (and why data is fun)</title>
		<link>http://gregklein.wordpress.com/2013/01/22/chess-and-why-data-is-fun/</link>
		<comments>http://gregklein.wordpress.com/2013/01/22/chess-and-why-data-is-fun/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 23:50:40 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[chess]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=307</guid>
		<description><![CDATA[I&#8217;ve been playing chess (and with chess) quite a lot recently. I started up playing online chess again (on chess.com), and I&#8217;ve been having quite a lot of fun with it. This quickly moved into playing with chess in Python, and I&#8217;ve had quite a lot of fun with that, especially thanks to a nifty [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=307&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been playing chess (and with chess) quite a lot recently. I started up playing online chess again (on <a href="http://chess.com">chess.com</a>), and I&#8217;ve been having quite a lot of fun with it. This quickly moved into playing with chess in Python, and I&#8217;ve had quite a lot of fun with that, especially thanks to a <a href="http://www.alcyone.com/software/chess/">nifty chess library</a> I found for python. One of the things I realized is that chess.com makes quite a lot of data available for each user. For example, I can download a <a href="http://en.wikipedia.org/wiki/Portable_Game_Notation">.pgn file</a> of the last few weeks of games that I have played (I ended up downloading about 40 chess games that I&#8217;ve played &#8212; I could get more games but unfortunately I need to pay for a real account if I want this).</p>
<p>This is a lot of data, so I decided to try to do something with it. I ended up producing this:</p>
<div id="attachment_308" class="wp-caption aligncenter" style="width: 515px"><a href="http://gregklein.files.wordpress.com/2013/01/all_pieces.png"><img class="size-large wp-image-308" alt="All of the chess moves that I've made in the last 4 weeks." src="http://gregklein.files.wordpress.com/2013/01/all_pieces.png?w=505&#038;h=510" width="505" height="510" /></a><p class="wp-caption-text">All of the chess moves that I&#8217;ve made in the last 4 weeks.</p></div>
<p>This represents all of the chess moves made in about 40 chess games I&#8217;ve played, coloured by piece. Rooks are gold, kings are purple, pawns are blue, bishops are green, knights are red, and queens are black. I also made a few images representing only certain pieces, here&#8217;s one with only the knights:</p>
<div id="attachment_311" class="wp-caption aligncenter" style="width: 515px"><a href="http://gregklein.files.wordpress.com/2013/01/knights.png"><img class="size-large wp-image-311" alt="All of the moves made by knights in my recent games." src="http://gregklein.files.wordpress.com/2013/01/knights.png?w=505&#038;h=504" width="505" height="504" /></a><p class="wp-caption-text">All of the moves made by knights in my recent games.</p></div>
<p>Most of the work that I did on this project actually went into producing the graphics rather than interpreting the files. I got the best results (that you see here) by using <a href="http://pyx.sourceforge.net/">PYX</a> curves. Each arc that you see in the images represents a move. The degree of the arcs (how wide the are, etc) is randomly generated so that multiple &#8220;moves&#8221; don&#8217;t overlap. This way we can see, that, for example, I like to move my knights to c3 and g3 quite a lot.</p>
<p>Oh, and if you&#8217;d like to play chess with me, feel free to <a href="http://www.chess.com/members/view/inklein">challenge me online</a>. I can&#8217;t guarantee that I&#8217;m any good at chess, though, so it might be a bit embarrassing for me.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/307/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=307&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2013/01/22/chess-and-why-data-is-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2013/01/all_pieces.png?w=693" medium="image">
			<media:title type="html">All of the chess moves that I&#039;ve made in the last 4 weeks.</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2013/01/knights.png?w=700" medium="image">
			<media:title type="html">All of the moves made by knights in my recent games.</media:title>
		</media:content>
	</item>
		<item>
		<title>Playing with Surface Mount Shift Registers</title>
		<link>http://gregklein.wordpress.com/2012/10/16/playing-with-surface-mount-shift-registers/</link>
		<comments>http://gregklein.wordpress.com/2012/10/16/playing-with-surface-mount-shift-registers/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 06:41:55 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=303</guid>
		<description><![CDATA[I&#8217;ve been playing for a while with making my own circuit boards with OSH Park. Usually these are reasonably large two sided boards and they typically cost me $8-$25 each. But OSH Park doesn&#8217;t have a setup fee or minimum board size. So I decided to see how small of a circuit board I could [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=303&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been playing for a while with making my own circuit boards with <a href="http://oshpark.com/">OSH Park</a>. Usually these are reasonably large two sided boards and they typically cost me $8-$25 each. But OSH Park doesn&#8217;t have a setup fee or minimum board size. So I decided to see how small of a circuit board I could make.</p>
<div id="attachment_304" class="wp-caption aligncenter" style="width: 516px"><a href="http://gregklein.files.wordpress.com/2012/10/blinkenlights.jpg"><img class=" wp-image-304" title="blinkenlights" alt="" src="http://gregklein.files.wordpress.com/2012/10/blinkenlights.jpg?w=506&#038;h=378" height="378" width="506" /></a><p class="wp-caption-text">A bunch of surface mount LEDs sitting on a tiny PCB.</p></div>
<p>The result is a really simple board that&#8217;s pretty fun to solder. The boards came out to something like $2 each, and the parts, not including connectors, were about as cheap (connectors are pricey! This was a surprise for me).</p>
<p>If you couldn&#8217;t guess, each PCB is just a breakout board for a <a href="http://www.arduino.cc/en/Tutorial/ShiftOut">595 surface mount shift register</a> mounted on the backside of the board. Each output pin of the shift register is tied to an LED with an inline resistor.</p>
<p>Here&#8217;s a video of these boards being driven by an arduino:</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='700' height='424' src='http://www.youtube.com/embed/40Y1gaPSUc4?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>All in all, a really cheap and easy project.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=303&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2012/10/16/playing-with-surface-mount-shift-registers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/10/blinkenlights.jpg?w=1024" medium="image">
			<media:title type="html">blinkenlights</media:title>
		</media:content>
	</item>
		<item>
		<title>Programming External Chips with the MSP Launchpad</title>
		<link>http://gregklein.wordpress.com/2012/03/04/programming-external-chips-with-the-msp-launchpad/</link>
		<comments>http://gregklein.wordpress.com/2012/03/04/programming-external-chips-with-the-msp-launchpad/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 00:58:26 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[msp430]]></category>
		<category><![CDATA[microcontroller]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=286</guid>
		<description><![CDATA[This is more of a note to myself than anything else, but here goes. I&#8217;ve been playing around a lot with the MSP430 line of microcontrollers and I&#8217;ve been using the MSP Launchpad as a programmer. It&#8217;s an exceedingly cheap programmer ($4.30), so it&#8217;s pretty fun to play around with. Basically, there&#8217;s a socket for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=286&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is more of a note to myself than anything else, but here goes.</p>
<p>I&#8217;ve been playing around a lot with the <a title="MSP430" href="http://en.wikipedia.org/wiki/MSP430">MSP430</a> line of microcontrollers and I&#8217;ve been using the <a title="msp launchpad" href="http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_%28MSP-EXP430G2%29">MSP Launchpad</a> as a programmer. It&#8217;s an exceedingly cheap programmer ($4.30), so it&#8217;s pretty fun to play around with. Basically, there&#8217;s a socket for a 14 or 20 pin <a href="http://en.wikipedia.org/wiki/Dual_in-line_package">DIP</a> MSP430 with the pins broken out. Pop a chip in, program it, and play. Neat.</p>
<p>But sometimes I develop something where the chip is soldered in and then there&#8217;s no good way to pop out the chip to reprogram. Like the pocketwatch I made (actually the chip is socketed, but I&#8217;d like to avoid that):</p>
<div id="attachment_287" class="wp-caption aligncenter" style="width: 514px"><a href="http://gregklein.files.wordpress.com/2012/03/img_0496.jpg"><img class=" wp-image-287" title="IMG_0496" src="http://gregklein.files.wordpress.com/2012/03/img_0496.jpg?w=504&#038;h=377" alt="" width="504" height="377" /></a><p class="wp-caption-text">My pocketwatch.</p></div>
<p>So, to program the MSP430 microcontroller without socketing it into the launchpad, all that needs to be done is the following: remove all of the jumpers from the MSP launchpad. Then connect TEST and RST from the uppermost section of the launchpad to the chip that you&#8217;d like to program. Also connect GND to the ground of your design.</p>
<p>That should be it, you&#8217;re ready to program. And don&#8217;t forget to put a 47kΩ resistor from Vcc to RST on your chip in your design or it won&#8217;t boot!</p>
<div id="attachment_291" class="wp-caption aligncenter" style="width: 516px"><a href="http://gregklein.files.wordpress.com/2012/03/img_0017.jpg"><img class=" wp-image-291" title="IMG_0017" src="http://gregklein.files.wordpress.com/2012/03/img_0017.jpg?w=506&#038;h=378" alt="" width="506" height="378" /></a><p class="wp-caption-text">All connected and ready to program</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=286&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2012/03/04/programming-external-chips-with-the-msp-launchpad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/03/img_0496.jpg?w=300" medium="image">
			<media:title type="html">IMG_0496</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/03/img_0017.jpg?w=300" medium="image">
			<media:title type="html">IMG_0017</media:title>
		</media:content>
	</item>
		<item>
		<title>T-Square Fractal Cubes</title>
		<link>http://gregklein.wordpress.com/2012/02/17/t-square-fractal-cubes/</link>
		<comments>http://gregklein.wordpress.com/2012/02/17/t-square-fractal-cubes/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 00:03:32 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[fractal]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[t square]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=279</guid>
		<description><![CDATA[If you don&#8217;t already know, I like fractals a lot. A few months ago I was playing around with the T-Square fractal. Recently I decided to revisit this fractal and try to add another dimension. So instead of using squares, I decided that I&#8217;d use cubes and make the rules the same. For each free [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=279&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>If you don&#8217;t already know, I <a href="http://greg.hibal.org/fractal/square_chaos.png">like</a> <a href="http://gregklein.wordpress.com/2012/01/16/fun-with-an-hp-7475-plotter/">fractals</a> <a href="https://code.google.com/p/4d-buddhabrot-render/">a</a> <a href="http://greg.hibal.org/fractal/Wireframe_fractal.png">lot</a>.</p>
<p>A few months ago I was playing around with the <a href="http://en.wikipedia.org/wiki/T-square_%28fractal%29">T-Square</a> fractal. Recently I decided to revisit this fractal and try to add another dimension. So instead of using squares, I decided that I&#8217;d use cubes and make the rules the same. For each free corner on a cube, create another cube and repeat.</p>
<p>So I wrote a small program in <a href="http://en.wikipedia.org/wiki/Python_programming_language">Python</a> that creates a scene for <a href="http://en.wikipedia.org/wiki/Povray">Povray</a> (speaking of which, I wasn&#8217;t able to find any good libraries for talking to Povray in Python! If anyone knows of such a library, I&#8217;d love to know.)</p>
<p>Anyway, here are the results:</p>
<div id="attachment_280" class="wp-caption aligncenter" style="width: 515px"><a href="http://gregklein.files.wordpress.com/2012/02/cubes_soft.png"><img class=" wp-image-280" title="cubes_soft" alt="T-Cube Fractal" src="http://gregklein.files.wordpress.com/2012/02/cubes_soft.png?w=505&#038;h=377" width="505" height="377" /></a><p class="wp-caption-text">T-Cube fractal iterated 9 deep</p></div>
<p>I&#8217;d love to make a video out of this but I don&#8217;t think my budget can afford it right now. The frame you see above you took about an hour or so to render on my laptop. Unless anyone has a cluster they&#8217;re willing to lend me, I&#8217;ll have to stick to stills for now.</p>
<p><strong>Update 3/26/12:</strong></p>
<p>I decided to 3d print it. Printed on a <a href="http://en.wikipedia.org/wiki/3D_printing">3d powder printer</a> at <a href="http://makersfactory.com/">Makers Factory</a> in Santa Cruz.</p>
<p>In order to get it made into a proper 3d file, I actually ended up writing a Python script for <a title="Blender" href="http://blender.org">Blender</a>, you can find that <a title="Python file for T-Square cube" href="http://greg.hibal.org/cube_3d_files/cubes.py_sillyserverpythonfilesareforkids">here</a>. Turns out that scripting Blender is way easier than writing .STL files &#8212; just to write a cube you need to define a bunch of vertices&#8217;s and get them all in the right order or the normals are screwed up.</p>
<div id="attachment_297" class="wp-caption aligncenter" style="width: 514px"><a href="http://gregklein.files.wordpress.com/2012/02/7019558227_84775a2e50_b.jpg"><img class=" wp-image-297" title="3d printed fractal cube" alt="" src="http://gregklein.files.wordpress.com/2012/02/7019558227_84775a2e50_b.jpg?w=504&#038;h=377" width="504" height="377" /></a><p class="wp-caption-text">And a 3d print of the fractal with only 6 iterations this time.</p></div>
<p><strong>Update (again) 4/16/12:</strong></p>
<p>I sent away to <a title="shapeways" href="http://shapeways.com">Shapeways</a> to get it printed in <a href="http://www.shapeways.com/materials/white_strong_flexible">black plastic</a>.</p>
<div id="attachment_299" class="wp-caption aligncenter" style="width: 514px"><a href="http://gregklein.files.wordpress.com/2012/02/img_0077.jpg"><img class=" wp-image-299" title="Black 3d printed fractal cube" alt="" src="http://gregklein.files.wordpress.com/2012/02/img_0077.jpg?w=504&#038;h=377" width="504" height="377" /></a><p class="wp-caption-text">3d printed fractal from Shapeways</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=279&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2012/02/17/t-square-fractal-cubes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/02/cubes_soft.png?w=300" medium="image">
			<media:title type="html">cubes_soft</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/02/7019558227_84775a2e50_b.jpg?w=300" medium="image">
			<media:title type="html">3d printed fractal cube</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/02/img_0077.jpg?w=300" medium="image">
			<media:title type="html">Black 3d printed fractal cube</media:title>
		</media:content>
	</item>
		<item>
		<title>Lasers, Smoke, and Ice</title>
		<link>http://gregklein.wordpress.com/2012/01/26/lasers-smoke-and-ice/</link>
		<comments>http://gregklein.wordpress.com/2012/01/26/lasers-smoke-and-ice/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 20:53:05 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=267</guid>
		<description><![CDATA[Smoke is really interesting. It&#8217;s a gas, so it ends up being very chaotic, especially when turbulent. I was playing with lasers the other day and had the idea to make two-dimensional a plane of laser light and project it through smoke, effectively visually &#8216;cutting&#8217; the laser smoke into a slice that I could see. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=267&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Smoke is really interesting. It&#8217;s a gas, so it ends up being <a href="http://en.wikipedia.org/wiki/Fluid_turbulence">very chaotic</a>, especially when turbulent.</p>
<p>I was playing with lasers the other day and had the idea to make two-dimensional a plane of laser light and project it through smoke, effectively visually &#8216;cutting&#8217; the laser smoke into a slice that I could see. So I attached a mirror with a 45 degree tilt to a computer fan, pointed a 5mW green laser at it, and spun it up.</p>
<p>After searching for the appropriate medium to create smoke (incense didn&#8217;t make enough to be very visual), my friends and I settled on using dry ice.</p>
<p>Here&#8217;s a picture with the lights on.</p>
<div id="attachment_269" class="wp-caption aligncenter" style="width: 515px"><a href="http://gregklein.files.wordpress.com/2012/01/imgp4747.jpg"><img class=" wp-image-269" title="IMGP4747" src="http://gregklein.files.wordpress.com/2012/01/imgp4747.jpg?w=505&#038;h=334" alt="" width="505" height="334" /></a><p class="wp-caption-text">Pouring dry ice vapor through a plane of laser light.</p></div>
<p>And another with the lights out, this time of just a cube of dry ice held above the laser:</p>
<div id="attachment_270" class="wp-caption aligncenter" style="width: 514px"><a href="http://gregklein.files.wordpress.com/2012/01/imgp4806.jpg"><img class=" wp-image-270" title="IMGP4806" src="http://gregklein.files.wordpress.com/2012/01/imgp4806.jpg?w=504&#038;h=333" alt="" width="504" height="333" /></a><p class="wp-caption-text">Dry ice cube held in a plane of laser light</p></div>
<p>The whole device was really easy to build (most computer case fans take 12 volts DC and you can get small mirrors at art supply stores). If you do end up making one of these devices, just please remember to be safe around lasers and dry ice. Never look a laser in the eye and never keep dry ice in an airtight container (it will explode).</p>
<p>And I&#8217;ll leave you with a video:</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='700' height='424' src='http://www.youtube.com/embed/9ssDSM3d3hY?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>Oh, and thanks to Julia for helping and <a href="http://www.jonagill.com/">Jon</a> for the photography.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/267/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=267&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2012/01/26/lasers-smoke-and-ice/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/01/imgp4747.jpg?w=300" medium="image">
			<media:title type="html">IMGP4747</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/01/imgp4806.jpg?w=300" medium="image">
			<media:title type="html">IMGP4806</media:title>
		</media:content>
	</item>
		<item>
		<title>Fun with an HP 7475 Plotter</title>
		<link>http://gregklein.wordpress.com/2012/01/16/fun-with-an-hp-7475-plotter/</link>
		<comments>http://gregklein.wordpress.com/2012/01/16/fun-with-an-hp-7475-plotter/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 04:05:39 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[fractal]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=250</guid>
		<description><![CDATA[So I got an HP 7475 Plotter used. I&#8217;ve been playing with it using a Python library called Chiplotle. Recently I&#8217;ve been making fractals on it. Here&#8217;s a Hilbert curve I made: Hilbert curves are space filling fractal curves. This means that when iterated to infinity, at no point is there a straight line; thus [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=250&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So I got an <a title="HP 7475a" href="http://www.hpmuseum.net/display_item.php?hw=74">HP 7475 Plotter</a> used. I&#8217;ve been playing with it using a Python library called <a href="http://music.columbia.edu/cmc/chiplotle/manual/index.html">Chiplotle</a>.</p>
<p>Recently I&#8217;ve been making fractals on it. Here&#8217;s a <a href="http://en.wikipedia.org/wiki/Hilbert_curve">Hilbert curve</a> I made:</p>
<div id="attachment_251" class="wp-caption aligncenter" style="width: 515px"><a href="http://gregklein.files.wordpress.com/2012/01/hilbert.jpeg"><img class=" wp-image-251 " title="hilbert" alt="" src="http://gregklein.files.wordpress.com/2012/01/hilbert.jpeg?w=505&#038;h=377" width="505" height="377" /></a><p class="wp-caption-text">Hilbert curve on a plotter</p></div>
<p style="text-align:left;">Hilbert curves are space filling fractal curves. This means that when iterated to infinity, at no point is there a straight line; thus it is a curve. Very neat!</p>
<div id="attachment_252" class="wp-caption aligncenter" style="width: 514px"><a href="http://gregklein.files.wordpress.com/2012/01/dense_hilbert.jpg"><img class=" wp-image-252" title="dense_hilbert" alt="" src="http://gregklein.files.wordpress.com/2012/01/dense_hilbert.jpg?w=504&#038;h=377" width="504" height="377" /></a><p class="wp-caption-text">Iterated deeper this time</p></div>
<p style="text-align:left;">In order to get this to work, I wrote a <a href="http://en.wikipedia.org/wiki/Turtle_graphics">turtle graphics</a> class for the Chiplotle library. If anyone finds this useful, you can grab the code <a href="http://greg.hibal.org/plotter/code/plotterturtle.txt">here</a>.</p>
<p style="text-align:left;">Oh, and here&#8217;s a <a href="http://en.wikipedia.org/wiki/Sierpinski_triangle">Sierpinski triangle</a>:</p>
<div id="attachment_258" class="wp-caption aligncenter" style="width: 515px"><a href="http://gregklein.files.wordpress.com/2012/01/sierpinski.jpg"><img class=" wp-image-258" title="Sierpinski" alt="" src="http://gregklein.files.wordpress.com/2012/01/sierpinski.jpg?w=505&#038;h=376" width="505" height="376" /></a><p class="wp-caption-text">A Sierpinski Triangle</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/250/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=250&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2012/01/16/fun-with-an-hp-7475-plotter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/01/hilbert.jpeg?w=300" medium="image">
			<media:title type="html">hilbert</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/01/dense_hilbert.jpg?w=300" medium="image">
			<media:title type="html">dense_hilbert</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2012/01/sierpinski.jpg?w=300" medium="image">
			<media:title type="html">Sierpinski</media:title>
		</media:content>
	</item>
		<item>
		<title>LEDs on a String</title>
		<link>http://gregklein.wordpress.com/2011/11/14/leds-on-a-string/</link>
		<comments>http://gregklein.wordpress.com/2011/11/14/leds-on-a-string/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 23:49:45 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[math]]></category>
		<category><![CDATA[leds]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[long exposure]]></category>
		<category><![CDATA[pretty]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=225</guid>
		<description><![CDATA[Okay, so a friend and I got bored and decided to play with this idea. We attached a few leds to some thin string (we used dental floss), creating a pendulum. Then we turned off the lights, pointed a camera up, opened the shutter for about 25 seconds and released the led: And then we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=225&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Okay, so a friend and I got bored and decided to play with this idea. We attached a few <a title="LED on wikipedia" href="http://en.wikipedia.org/wiki/Light_emitting_diode">leds</a> to some thin string (we used dental floss), creating a pendulum. Then we turned off the lights, pointed a camera up, opened the shutter for about 25 seconds and released the led:</p>
<div id="attachment_226" class="wp-caption aligncenter" style="width: 624px"><a href="http://gregklein.files.wordpress.com/2011/11/img_3500-e1321313977792.jpg"><img class="size-large wp-image-226  " title="A single red led as a pendulum." src="http://gregklein.files.wordpress.com/2011/11/img_3500-e1321313977792.jpg?w=614&#038;h=409" alt="" width="614" height="409" /></a><p class="wp-caption-text">A 25 second exposure of a single red led.</p></div>
<p style="text-align:center;">And then we tried making a double pendulum by adding a second, green, led.</p>
<div id="attachment_231" class="wp-caption aligncenter" style="width: 629px"><a href="http://gregklein.files.wordpress.com/2011/11/img_3498-e1321314130347.jpg"><img class="size-large wp-image-231    " title="Double led pendulum" src="http://gregklein.files.wordpress.com/2011/11/img_3498-e1321314130347.jpg?w=619&#038;h=412" alt="" width="619" height="412" /></a><p class="wp-caption-text">And again, but with two leds to create a double pendulum.</p></div>
<p><a href="http://en.wikipedia.org/wiki/Double_pendulum">Double pendulums</a> are neat! They&#8217;re incredibly complex despite their simple construction, but can be <a href="http://scienceworld.wolfram.com/physics/DoublePendulum.html">correctly modelled</a> with math.</p>
<p>Here&#8217;s our setup for the double pendulum. And remember, if you decide to try this, use a resistor in series with each led.</p>
<div id="attachment_237" class="wp-caption aligncenter" style="width: 344px"><a href="http://gregklein.files.wordpress.com/2011/11/img_3493.jpg"><img class="size-large wp-image-237 " title="Double pendulum setup" src="http://gregklein.files.wordpress.com/2011/11/img_3493.jpg?w=334&#038;h=502" alt="" width="334" height="502" /></a><p class="wp-caption-text">The double pendulum with the lights on.</p></div>
<p style="text-align:center;">
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=225&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2011/11/14/leds-on-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2011/11/img_3500-e1321313977792.jpg?w=1024" medium="image">
			<media:title type="html">A single red led as a pendulum.</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2011/11/img_3498-e1321314130347.jpg?w=1024" medium="image">
			<media:title type="html">Double led pendulum</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2011/11/img_3493.jpg?w=682" medium="image">
			<media:title type="html">Double pendulum setup</media:title>
		</media:content>
	</item>
		<item>
		<title>Quadcopter Crash</title>
		<link>http://gregklein.wordpress.com/2011/10/20/quadcopter-crash/</link>
		<comments>http://gregklein.wordpress.com/2011/10/20/quadcopter-crash/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 06:51:49 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[quadcopter]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=211</guid>
		<description><![CDATA[So I&#8217;m building a quadcopter. Here&#8217;s the project webpage. A big part of the whole process is learning to fly. As I&#8217;ve never flown an rc aircraft before, it&#8217;s pretty tricky to learn on something you just designed and built. So, more often than not, I crash. &#160; (Don&#8217;t worry, no permanent damage was done.) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=211&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So I&#8217;m building a quadcopter. Here&#8217;s the <a title="Greg's quadcopter" href="http://quad.greg.hibal.org">project webpage</a>.</p>
<p>A big part of the whole process is learning to fly. As I&#8217;ve never flown an rc aircraft before, it&#8217;s pretty tricky to learn on something you just designed and built. So, more often than not, I crash.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='700' height='424' src='http://www.youtube.com/embed/nUC-SymI3yk?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>&nbsp;</p>
<p>(Don&#8217;t worry, no permanent damage was done.)</p>
<p>Now a lot of these crashes are because I lost control or because I just can&#8217;t fly. But I think this one was very interesting. If you take a look at the video again, you&#8217;ll notice that I was tilting the aircraft back towards me when the rear motor seems to cut out, levelling the craft and eventually crashing it. I&#8217;m fairly sure that I had nothing to do with that.</p>
<p>What I think happened is that my quadcopter went into something similar to a <a title="deep stall" href="http://en.wikipedia.org/wiki/Deep_stall#Deep_stall">deep stall</a>. When the quadcopter is leaning forward too much, the rear rotor is sucking in turbulent air, and unable to provide enough lift.</p>
<div id="attachment_215" class="wp-caption aligncenter" style="width: 624px"><a href="http://gregklein.files.wordpress.com/2011/10/quad_deep_stall.jpeg"><img class="size-large wp-image-215 " title="Deep Stall" src="http://gregklein.files.wordpress.com/2011/10/quad_deep_stall.jpeg?w=614&#038;h=391" alt="Quadcopter stalling" width="614" height="391" /></a><p class="wp-caption-text">As the quadcopter moves forward, the rear propeller gets turbulent air and can&#039;t provide lift any more.</p></div>
<p>I&#8217;ll be playing around with the thing soon and I hope to reproduce the conditions under which this happened.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=211&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2011/10/20/quadcopter-crash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>

		<media:content url="http://gregklein.files.wordpress.com/2011/10/quad_deep_stall.jpeg?w=1024" medium="image">
			<media:title type="html">Deep Stall</media:title>
		</media:content>
	</item>
		<item>
		<title>Buddhabrot 4-Dimensional Rotation</title>
		<link>http://gregklein.wordpress.com/2011/05/16/buddhabrot-4-dimensional-rotation/</link>
		<comments>http://gregklein.wordpress.com/2011/05/16/buddhabrot-4-dimensional-rotation/#comments</comments>
		<pubDate>Mon, 16 May 2011 08:55:57 +0000</pubDate>
		<dc:creator>gregklein</dc:creator>
				<category><![CDATA[fractal]]></category>

		<guid isPermaLink="false">http://gregklein.wordpress.com/?p=185</guid>
		<description><![CDATA[I&#8217;ve been playing with fractals recently. More specifically, the Buddhabrot fractal. The Buddhabrot set is closely related to the Mandelbrot set: The mandelbrot set is displayed on the complex plane, where one axis is the real component of (we&#8217;ll call it ) and the other is the imaginary component of (a.k.a ). With the Buddhabrot [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=185&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been playing with fractals recently. More specifically, the <a title="buddhabrot" href="http://en.wikipedia.org/wiki/Buddhabrot">Buddhabrot fractal</a>.</p>
<p>The Buddhabrot set is closely related to the <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot set</a>: <img src='http://s0.wp.com/latex.php?latex=Z_%7Bn%2B1%7D+%3D+Z%5E2_%7Bn%7D%2BC+&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='Z_{n+1} = Z^2_{n}+C ' title='Z_{n+1} = Z^2_{n}+C ' class='latex' /></p>
<p>The mandelbrot set is displayed on the <a href="http://en.wikipedia.org/wiki/Complex_plane">complex plane</a>, where one axis is the real component of <img src='http://s0.wp.com/latex.php?latex=C&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='C' title='C' class='latex' /> (we&#8217;ll call it <img src='http://s0.wp.com/latex.php?latex=C_r&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='C_r' title='C_r' class='latex' />) and the other is the imaginary component of <img src='http://s0.wp.com/latex.php?latex=C&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='C' title='C' class='latex' /> (a.k.a <img src='http://s0.wp.com/latex.php?latex=C_i&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='C_i' title='C_i' class='latex' />).</p>
<p>With the Buddhabrot set, we can add a few more axes. Instead of just using <img src='http://s0.wp.com/latex.php?latex=C_i&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='C_i' title='C_i' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=C_r&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='C_r' title='C_r' class='latex' />, we also use the real and imaginary components of <img src='http://s0.wp.com/latex.php?latex=Z_0&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='Z_0' title='Z_0' class='latex' /> as axes. Whereas in the Mandelbrot set, <img src='http://s0.wp.com/latex.php?latex=Z_0&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='Z_0' title='Z_0' class='latex' /> is assumed to be <img src='http://s0.wp.com/latex.php?latex=0%2B0i&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='0+0i' title='0+0i' class='latex' />, in our 4D Buddhabrot set, we make these values variable as well.</p>
<p>So instead of the two dimensional image you&#8217;re used to seeing of the Mandelbrot set, we&#8217;ve instead got 4 axes: <img src='http://s0.wp.com/latex.php?latex=C_i%2C+C_r%2C+Z_i%2C&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='C_i, C_r, Z_i,' title='C_i, C_r, Z_i,' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=Z_r&amp;bg=ffffff&amp;fg=1c1c1c&amp;s=0' alt='Z_r' title='Z_r' class='latex' />.</p>
<p>Which leads us to our next problem &#8212; how do you visualise a 4 dimensional object on a computer? Well, it&#8217;s difficult. You obviously can&#8217;t just draw an image of it, or even just show a 3 dimensional picture of it. Instead, we show it rotation in 4 dimensional space.</p>
<p>So, here&#8217;s the result:</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='700' height='424' src='http://www.youtube.com/embed/YNnhzwVeaRc?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>I&#8217;ve made all of this code open source &#8212; <a href="https://code.google.com/p/4d-buddhabrot-render/">here&#8217;s the project page</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregklein.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregklein.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregklein.wordpress.com&#038;blog=8588163&#038;post=185&#038;subd=gregklein&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregklein.wordpress.com/2011/05/16/buddhabrot-4-dimensional-rotation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/953ba36ce89e55c4fd30989da35e6e37?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregklein</media:title>
		</media:content>
	</item>
	</channel>
</rss>
