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

<channel>
	<title>Jordan Perr &#187; programming</title>
	<atom:link href="http://jperr.com/wp/tags/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://jperr.com/wp</link>
	<description>A public display of my projects and thoughts.</description>
	<lastBuildDate>Mon, 23 Aug 2010 20:03:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Processing Chaos</title>
		<link>http://jperr.com/wp/post/280</link>
		<comments>http://jperr.com/wp/post/280#comments</comments>
		<pubDate>Thu, 18 Mar 2010 05:48:21 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[Left Brain]]></category>
		<category><![CDATA[Right Brain]]></category>
		<category><![CDATA[chaos]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://jperr.com/wp/?p=280</guid>
		<description><![CDATA[After reading the wonderful Chaos (James Gleik), I was inspired to pick up a copy of The Computational Beauty of Nature (Gary Flake) and explore chaotic computation for myself! My tool of choice was Processing, a simplified yet powerful programming language built on Java. I began this endeavor by exploring the Mandelbrot set with Zlata [...]]]></description>
			<content:encoded><![CDATA[<p>After reading the wonderful <a href="http://www.amazon.com/Chaos-Making-Science-James-Gleick/dp/0140092501">Chaos (James Gleik)</a>, I was inspired to pick up a copy of <a href="http://mitpress.mit.edu/books/FLAOH/cbnhtml/home.html">The Computational Beauty of Nature (Gary Flake)</a> and explore chaotic computation for myself! My tool of choice was <a href="http://processing.org/">Processing</a>, a simplified yet powerful programming language built on Java.</p>
<p>I began this endeavor by exploring the Mandelbrot set with Zlata over the <a href="http://esp.mit.edu/learn/Spark/index.html">MIT Spark</a> weekend. In the wee hours of Sunday morning, the first grainy images of the Mandelbrot set came into view. Uplifted by this success, we toiled tirelessly to create a full color, zoomable, and downright <em>awesome</em> fractal generator.</p>
<div id="attachment_281" class="wp-caption aligncenter" style="width: 302px"><a href="http://jperr.com/wp/wp-content/uploads/2010/03/Screen-shot-2010-03-15-at-5.39.28-AM.png"><img class="size-medium wp-image-281" title="Mandelbrot1" src="http://jperr.com/wp/wp-content/uploads/2010/03/Screen-shot-2010-03-15-at-5.39.28-AM-292x300.png" alt="" width="292" height="300" /></a><p class="wp-caption-text">One of the best renderings from our Mandelbrot generator.</p></div>
<h2 style="text-align: center;"><a href="http://jperr.com/wpstatic/processing/Mandelbrot">View Demo</a></h2>
<p>Adding color was one of the toughest challenges we encountered. The standard RGB color notation is great for most purposes, but it really does fall short for generating the <em>spectrum</em>. In order to more easily generate a smooth color spectrum, we switched the project to HSL color and were able to simply scale the &#8220;H&#8221; (hue) property with each point&#8217;s iteration count.</p>
<p>Another interesting problem which still exists as a &#8220;bug&#8221; in the demo applet above is the lower limit imposed by the floating point datatype. As you zoom in farther and farther, the coordinates shrink down to absurdly small and precise values. Eventually, the measly floating point becomes imprecise, and the display seems pixelated. An easy fix would be switching all datatypes to doubles or bignums, but that would just take too much effort. It works!</p>
<p>Next I tackled the Lorenz Attractor. One of many such &#8220;strange attractors&#8221; that visualize the changes in a dynamic system by plotting the system&#8217;s state in &#8220;system space.&#8221; In the case of the Lorenz Attractor, fluid convection is represented in 3-space by the following set of equations:<br />
<code>From hypertextbook.com:<br />
dx/dt = σ(y − x)<br />
dy/dt = ρx − y − xz<br />
dz/dt = xy − βz</code><br />
As stated above, &#8220;x&#8221; is the convective flow, &#8220;y&#8221; is the horizontal temperature distribution, and &#8220;z&#8221; is the vertical temperature distribution of the system. Curiously, the orbit of point (x,y,z) over time will not &#8220;settle down&#8221; or form a repetitious cycle given certain critical values for σ, ρ, and β. Instead, the orbit forms a magnificent, infinitely complex object known as a strange attractor.</p>
<div id="attachment_287" class="wp-caption aligncenter" style="width: 310px"><a href="http://jperr.com/wp/wp-content/uploads/2010/03/Screen-shot-2010-03-18-at-1.53.39-AM.png"><img class="size-medium wp-image-287" title="Lorenz1" src="http://jperr.com/wp/wp-content/uploads/2010/03/Screen-shot-2010-03-18-at-1.53.39-AM-300x239.png" alt="" width="300" height="239" /></a><p class="wp-caption-text">The Lorenz Attractor</p></div>
<h2 style="text-align: center;"><a href="http://jperr.com/wpstatic/processing/Lorenz">View Demo</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://jperr.com/wp/post/280/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bresenham&#8217;s Line Algorithm</title>
		<link>http://jperr.com/wp/post/259</link>
		<comments>http://jperr.com/wp/post/259#comments</comments>
		<pubDate>Wed, 17 Feb 2010 00:10:52 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[Left Brain]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://jperr.com/wp/?p=259</guid>
		<description><![CDATA[Bresenham&#8217;s line algorithm is the best known way to render a continuous and straight line through a raster display. I started out allowing floating point operations, but quickly decided to implement the algorithm using only integers. I didn&#8217;t like the online explanations and tutorials of the algo, so I decided to write something that I [...]]]></description>
			<content:encoded><![CDATA[<p>Bresenham&#8217;s line algorithm is the best known way to render a continuous and straight line through a raster display. I started out allowing floating point operations, but quickly decided to implement the algorithm using only integers. I didn&#8217;t like the online explanations and tutorials of the algo, so I decided to write something that I conceptually understood. View my code <a href='http://jperr.com/wp/wp-content/uploads/2010/02/main.c'>here</a>.</p>
<p><a href="http://jperr.com/wp/wp-content/uploads/2010/02/Screen-shot-2010-02-16-at-6.47.50-PM.png"><img src="http://jperr.com/wp/wp-content/uploads/2010/02/Screen-shot-2010-02-16-at-6.47.50-PM-288x300.png" alt="" title="Line Drawing Output" width="288" height="300" class="aligncenter size-medium wp-image-260" /></a></p>
<p>My algorithm works by increasing an &#8220;error&#8221; variable by y0 &#8211; y1 every iteration. Should the error ever rise above x0-x1, the error is decreased by x0 &#8211; x1 and the drawn Y value is increased by 1.</p>
]]></content:encoded>
			<wfw:commentRss>http://jperr.com/wp/post/259/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparing Accelerometer and Wheel Encoder Data</title>
		<link>http://jperr.com/wp/post/114</link>
		<comments>http://jperr.com/wp/post/114#comments</comments>
		<pubDate>Fri, 18 Dec 2009 01:47:44 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[Left Brain]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[frc]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[robotics]]></category>
		<category><![CDATA[sensors]]></category>

		<guid isPermaLink="false">http://jperr.com/wp/?p=114</guid>
		<description><![CDATA[A necessary but mundane task of programming any vehicle&#8217;s autonomous drive system is filtering the noise out of encoder and accelerometer sensory data. To demonstrate the noisiness of our sensors to the rest of the FRC team, I decided to create visual aids using Microsoft Excel. The following graph shows both sets of data over [...]]]></description>
			<content:encoded><![CDATA[<p>A necessary but mundane task of programming any vehicle&#8217;s autonomous drive system is filtering the noise out of encoder and accelerometer sensory data. To demonstrate the noisiness of our sensors to the rest of the FRC team, I decided to create visual aids using Microsoft Excel. The following graph shows both sets of data over time during smooth acceleration and deceleration.</p>
<div id="attachment_115" class="wp-caption aligncenter" style="width: 610px"><a rel="attachment wp-att-115" href="http://jperr.com/wp/post/114/smooth"><img class="size-full wp-image-115 " title="Smooth Encoders and Accelerometer" src="http://jperr.com/wp/wp-content/uploads/2009/12/Smooth.png" alt="Accelerometer and encoder data on progbot for a &quot;smooth&quot; driving trial." width="600" height="412" /></a><p class="wp-caption-text">Accelerometer and encoder data on progbot for a &quot;smooth&quot; driving trial.</p></div>
<div id="attachment_116" class="wp-caption aligncenter" style="width: 610px"><a rel="attachment wp-att-116" href="http://jperr.com/wp/post/114/slipping"><img class="size-full wp-image-116 " title="Slipping Accel and Encoder" src="http://jperr.com/wp/wp-content/uploads/2009/12/Slipping.png" alt="Accelerometer and encoder data for a very rough trial with progbot. The wheels were slipping at points during this trial." width="600" height="410" /></a><p class="wp-caption-text">Accelerometer and encoder data for a very rough trial with progbot. The wheels were slipping at points during this trial.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://jperr.com/wp/post/114/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pointdrive for Desbot</title>
		<link>http://jperr.com/wp/post/29</link>
		<comments>http://jperr.com/wp/post/29#comments</comments>
		<pubDate>Tue, 08 Dec 2009 03:15:37 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[Left Brain]]></category>
		<category><![CDATA[frc]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[robotics]]></category>
		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://jperr.com/wp/?p=29</guid>
		<description><![CDATA[Pointdrive is a revolutionary control system developed by me and a small team of programmers for Stuyvesant FRC&#8217;s 2007-2008 season. The system includes a bezier curve interpreter (written in C) onboard the robot&#8217;s IFI PIC18 RC unit as well as an AdobeSVG file converter on the host PC. This novel system allows drivers to literally [...]]]></description>
			<content:encoded><![CDATA[<p>Pointdrive is a revolutionary control system developed by me and a small team of programmers for <a href="http://stuypulse.com" target="_blank">Stuyvesant</a><a href="http://stuypulse.com"> FRC&#8217;s</a> 2007-2008 season. The system includes a bezier curve interpreter (written in C) onboard the robot&#8217;s IFI PIC18 RC unit as well as an AdobeSVG file converter on the host PC. This novel system allows drivers to literally <em>draw</em> the desired autonomous drive routine atop a map of the competition field, greatly reducing pre-match glitches and debugging.</p>
<ul>
<li>The code for Pointdrive is located somewhere in <a href="http://stuypulse-svn.dreamhosters.com/" target="_blank">this subversion repository</a>.</li>
<li>The Adobe SVG parsing <a href="http://stuypulse-svn.dreamhosters.com/frc/branches/svg/svg.py" target="_blank">script is located here</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jperr.com/wp/post/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
