<?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>nklein software &#187; spell-it</title>
	<atom:link href="http://nklein.com/tags/spell-it/feed/" rel="self" type="application/rss+xml" />
	<link>http://nklein.com</link>
	<description>software development and consulting</description>
	<lastBuildDate>Thu, 22 Dec 2011 04:42:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Animal Artwork and More Languages in iPhone Spelling App</title>
		<link>http://nklein.com/2010/03/animal-artwork-and-more-languages-in-iphone-spelling-app/</link>
		<comments>http://nklein.com/2010/03/animal-artwork-and-more-languages-in-iphone-spelling-app/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 16:09:02 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[New Versions]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=1261</guid>
		<description><![CDATA[I just finished up some animal artwork for my iPhone Spelling Toy. I also added translations for Japanese and German (in addition to the English, French, and Spanish that were already there). After I double-check the translations, I will get it uploaded to the App Store. If you have any expertise in Spanish, French, German, [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished up some animal artwork for my iPhone Spelling Toy.  I also added translations for Japanese and German (in addition to the English, French, and Spanish that were already there).  After I double-check the translations, I will get it uploaded to the App Store.</p>
<p><center><a href="http://nklein.com/wp-content/uploads/2010/03/spell-fish.png"><img src="http://nklein.com/wp-content/uploads/2010/03/spell-fish.png" alt="" title="spell-fish" width="480" height="320" class="alignnone size-full wp-image-1262" /></a></center></p>
<p>If you have any expertise in Spanish, French, German, or Japanese, I&#8217;d appreciate any feedback you can give me about the <a href="http://nklein.com/spell-it-words/">words I chose in those languages</a>.  Would they be the word one would think of when shown the picture?  Thanks, in advance.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2010/03/animal-artwork-and-more-languages-in-iphone-spelling-app/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Submitted small bug-fix to iPhone Spelling Toy</title>
		<link>http://nklein.com/2010/02/submitted-small-bug-fix-to-iphone-spelling-toy/</link>
		<comments>http://nklein.com/2010/02/submitted-small-bug-fix-to-iphone-spelling-toy/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 15:33:39 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Bug Fixes]]></category>
		<category><![CDATA[New Versions]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=1181</guid>
		<description><![CDATA[I just uploaded the first update to my iPhone Spelling Toy. The update includes two minor changes: Corrected spelling of siete (Spanish for seven) Corrected spelling of colores (Spanish for colors) Today, I am working on adding animal drawings.]]></description>
			<content:encoded><![CDATA[<p>I just uploaded the first update to my iPhone Spelling Toy.  The update includes two minor changes:</p>
<ul>
<li>Corrected spelling of <q>siete</q> (Spanish for <q>seven</q>)</li>
<li>Corrected spelling of <q>colores</q> (Spanish for <q>colors</q>)</li>
</ul>
<p>Today, I am working on adding animal drawings.</p>
<p><center><a href="http://nklein.com/wp-content/uploads/2010/02/spell-cat.png"><img src="http://nklein.com/wp-content/uploads/2010/02/spell-cat.png" alt="" title="spell-cat" width="270" height="270" class="size-full wp-image-1183" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2010/02/submitted-small-bug-fix-to-iphone-spelling-toy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spelling Toy iPhone App Released</title>
		<link>http://nklein.com/2010/02/spelling-toy-iphone-app-released/</link>
		<comments>http://nklein.com/2010/02/spelling-toy-iphone-app-released/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 02:30:37 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Initial Releases]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[iphone app]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=1172</guid>
		<description><![CDATA[I am pleased to announce, that my Spelling Toy for Kids is now available on the iTunes Store. The first five respondents to this article will receive a Promotional Code to download the app for free! (Edit: all promo codes dished out&#8230; if you really want one and will publicly review my app in your [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce, that my <a href="http://nklein.com/software/spell-it-iphone-app/">Spelling Toy for Kids</a> is now available on <a href="http://itunes.apple.com/us/app/nkleins-spell-it/id354611798?mt=8">the iTunes Store</a>.</p>
<p>The first five respondents to this article will receive a Promotional Code to download the app for free! <em>(Edit: all promo codes dished out&#8230; if you really want one and will publicly review my app in your blog, I&#8217;ll dig up another promo code for you.)</em></p>
<p><center><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/cJ4kh4aIakk&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/cJ4kh4aIakk&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></center></p>
<h3>Features</h3>
<ul>
<li>Kid-friendly interface!  Just pick the letters you want!</li>
<li>Guides your child to the proper spelling of each word.</li>
<li>Adapts to your child!  Cards that consistently give your child trouble show up more often.</li>
<li>Support for English, Spanish, and French! (German and Japanese Kana coming soon)</li>
<li>Lots of words to learn (with more coming soon).</li>
<li>Three different skill levels to challenge your kid!</li>
<li>Exercise some or all of the categories:  Numbers, Colors, Foods (with more coming soon).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2010/02/spelling-toy-iphone-app-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>iPhone App Submitted To The App Store</title>
		<link>http://nklein.com/2010/02/iphone-app-submitted-to-the-app-store/</link>
		<comments>http://nklein.com/2010/02/iphone-app-submitted-to-the-app-store/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 04:19:52 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iphone app]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=1169</guid>
		<description><![CDATA[I just submitted my first my first iPhone app to the App Store. Once it is approved, I will announce it here.]]></description>
			<content:encoded><![CDATA[<p>I just submitted my first <a href="http://nklein.com/software/spell-it-iphone-app/">my first iPhone app</a> to the App Store.  Once it is approved, I will announce it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2010/02/iphone-app-submitted-to-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spelling iPhone App sent to Beta Testers</title>
		<link>http://nklein.com/2010/01/spelling-iphone-app-sent-to-beta-testers/</link>
		<comments>http://nklein.com/2010/01/spelling-iphone-app-sent-to-beta-testers/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 03:08:33 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=1156</guid>
		<description><![CDATA[I am pleased to say that I just sent my first iPhone app out to some friends to beta test. I expect to forward it along to Apple for inclusion in the App Store some time in the next week or two. At this point, I am far more comfortable with Objective-C and the Cocoa [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to say that I just sent my <a href="http://nklein.com/software/spell-it-iphone-app/">first iPhone app</a> out to some friends to beta test.  I expect to forward it along to Apple for inclusion in the App Store some time in the next week or two.</p>
<p><a href="http://nklein.com/wp-content/uploads/2010/01/spell-it-large.jpg"><img src="http://nklein.com/wp-content/uploads/2010/01/spell-it-large-150x150.jpg" alt="" title="spell-it-large" width="150" height="150" class="alignright size-thumbnail wp-image-1157" /></a> At this point, I am far more comfortable with Objective-C and the Cocoa class hierarchy than I was even a month ago.  I still think Objective-C is awful.  You take a nice functional Smalltalk-ish language, you throw away most of the <q>functional</q>, you pretend like you have garbage collection when you don&#8217;t, you strip out any form of execution control, you add some funky compiler pragma-looking things (including one called <q>synthesize</q> that only fabricates about half of what you&#8217;d want it to build), you change the semantics of <q>-&gt;</q>, and then you interleave it with C!  Wahoo!  Instant headache!</p>
<p>But, after I found the for-each sort of construction, my code got quite a bit simpler.  A whole bunch of loops like this:</p>
<div class="codecolorer-container objc blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #400080;">NSEnumerator</span><span style="color: #002200;">*</span> ee <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>myArray enumerator<span style="color: #002200;">&#93;</span>;
MyItem<span style="color: #002200;">*</span> item;
<span style="color: #a61390;">while</span> <span style="color: #002200;">&#40;</span> <span style="color: #002200;">&#40;</span> item <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span>MyItem<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span>ee nextObject<span style="color: #002200;">&#93;</span> <span style="color: #002200;">&#41;</span> <span style="color: #002200;">!=</span> <span style="color: #a61390;">nil</span> <span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
   ...
<span style="color: #002200;">&#125;</span></pre></div>
<p>went to this:</p>
<div class="codecolorer-container objc blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span> MyItem<span style="color: #002200;">*</span> item <span style="color: #a61390;">in</span> myArrayOrEnumerator <span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
   ...
<span style="color: #002200;">&#125;</span></pre></div>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2010/01/spelling-iphone-app-sent-to-beta-testers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sneak Peek: Screenshot for Spelling iPhone App</title>
		<link>http://nklein.com/2009/05/sneak-peek-screenshot-for-spelling-iphone-app/</link>
		<comments>http://nklein.com/2009/05/sneak-peek-screenshot-for-spelling-iphone-app/#comments</comments>
		<pubDate>Wed, 06 May 2009 20:05:37 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[artwork]]></category>
		<category><![CDATA[iphone app]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=288</guid>
		<description><![CDATA[Earlier, I gave a sneak peek at some artwork for the children&#8217;s spelling game I am making for the iPhone. Here is a screenshot of the application (click for full size): I need to touch up the jaunty logo tiles in the upper left. Some of them are worse for the wear after the perspective [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier, I gave a <a href="http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/">sneak peek at some artwork</a> for the children&#8217;s spelling game I am making for the iPhone.  Here is a screenshot of the application (click for full size):<br />
<center><a href="http://nklein.com/wp-content/uploads/2009/05/spell-it-four.png"><img src="http://nklein.com/wp-content/uploads/2009/05/spell-it-four-300x159.png" alt="spell-it-four" title="spell-it-four" width="300" height="159" class="alignnone size-medium wp-image-290" /></a></center></p>
<p>I need to touch up the jaunty logo tiles in the upper left.  Some of them are worse for the wear after the perspective transformations and rotations.  More to follow&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/05/sneak-peek-screenshot-for-spelling-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Eureka Moment</title>
		<link>http://nklein.com/2009/05/a-eureka-moment/</link>
		<comments>http://nklein.com/2009/05/a-eureka-moment/#comments</comments>
		<pubDate>Fri, 01 May 2009 17:23:02 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=254</guid>
		<description><![CDATA[I was pondering the Phony Physics again as I set to work on my iPhone app. In the previous post, I twiddled the equations for damped spring motion until I found something visually pleasing. Last night, I went back to the drawing (a.k.a. white) board. What if I used an exponential spiral (parameterized by arc [...]]]></description>
			<content:encoded><![CDATA[<p>I was pondering the <a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/">Phony Physics</a> again as I set to work on my <a href="http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/">iPhone app</a>.</p>
<p>In the previous post, I twiddled the equations for damped spring motion until I found something visually pleasing.  Last night, I went back to the drawing (a.k.a. <q>white</q>) board.</p>
<p>What if I used an exponential spiral (parameterized by arc length).  Then, I could easily adjust the number of times it bounces back and forth.  I could use a spiral like <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_423e44d60380dbc2ae4d5767f351d4fd.png" title="r(t) = \alpha K (1-t)^n" style="vertical-align:-20%;" class="tex" alt="r(t) = \alpha K (1-t)^n" /> and <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_c08f3589a4375d6b7976b2258bab8abc.png" title="\theta(t) = K(1-t)" style="vertical-align:-20%;" class="tex" alt="\theta(t) = K(1-t)" /> where <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_7989e0ac09d9b7e9e3b541e36a5cb514.png" title="K" style="vertical-align:-20%;" class="tex" alt="K" /> is some multiple of <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2865ca0c5331aac3fceea41c25b3f97f.png" title="2\pi" style="vertical-align:-20%;" class="tex" alt="2\pi" />.  Then, I could walk along the spiral getting to the origin when <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4eea309dec2e2b71e1f70b7a4895f3ac.png" title="t = 1" style="vertical-align:-20%;" class="tex" alt="t = 1" /> going around the origin <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_0f8b4dccb0d9958e9165026a8b86e493.png" title="\frac{K}{2\pi}" style="vertical-align:-20%;" class="tex" alt="\frac{K}{2\pi}" /> times in the process.  If I follow the curve at a fixed rate, then I guarantee that my oscillations will pick up speed as I approach the origin.</p>
<p>Rather than have it spiral into the center, I am just using the x-coordinate of the spiral as my new <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> value to interpolate with.  I like the effect for the most part.  It overshoots a little bit far on the first oscillation.  I may tweak it some more before it&#8217;s all over.  For now though, I am sticking with it.</p>
<p>I will post some graphs soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/05/a-eureka-moment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sneak Peak: Artwork for Spelling iPhone App</title>
		<link>http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/</link>
		<comments>http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/#comments</comments>
		<pubDate>Fri, 01 May 2009 05:32:51 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[artwork]]></category>
		<category><![CDATA[iphone app]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=242</guid>
		<description><![CDATA[My first iPhone app is a children&#8217;s spelling game. Development is coming along well now that I&#8217;ve discovered cocos2d-iphone. I should have screenshots to show early next week. For now, here is a sneak peak at one of the cards in the game.]]></description>
			<content:encoded><![CDATA[<p>My first iPhone app is a children&#8217;s spelling game.  Development is coming along well now that I&#8217;ve discovered <a href="http://code.google.com/p/cocos2d-iphone/">cocos2d-iphone</a>.  I should have screenshots to show early next week.  For now, here is a sneak peak at one of the <q>cards</q> in the game.</p>
<p><center><a href="http://nklein.com/wp-content/uploads/2009/05/three.png"><img src="http://nklein.com/wp-content/uploads/2009/05/three.png" alt="three" title="three" width="256" height="256" class="size-full wp-image-243" style="border: black solid 0.25em;" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Phony Physics (a.k.a. Fun with Interpolation)</title>
		<link>http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/</link>
		<comments>http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 15:23:07 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[polynomials]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=187</guid>
		<description><![CDATA[In a previous post, I mentioned looking for a polynomial for an application. I am working on an application that involves clicking or dragging tiles around. Once you release the tile, I want it to snap to where it&#8217;s supposed to be. The easiest way to do this is to just warp it to where [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://nklein.com/2009/04/find-the-polynomial-youve-been-looking-for/">previous post</a>, I mentioned looking for a polynomial for an application.  I am working on an application that involves clicking or dragging tiles around. Once you release the tile, I want it to snap to where it&#8217;s supposed to be.</p>
<p>The easiest way to do this is to just warp it to where it&#8217;s supposed to go.  This isn&#8217;t very visually pleasing.  The next best thing is to set up a time-interval on which it moves into place.  Then, linearly interpolate from where it is to where it&#8217;s going (here with <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> normalized to range between zero and one):</p>
<p><center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_bc65e9f2a636dba26b596808b7606619.png" title="(1-t)x_0 + tx_1" style="vertical-align:-20%;" class="tex" alt="(1-t)x_0 + tx_1" /></center></p>
<p>That&#8217;s much better than just warping, but it doesn&#8217;t have any sort of fade-in or fade-out.  It instantaneously has its maximum velocity and then instantaneously stops at the end.</p>
<p>Typically, then one uses a cubic spline to scale the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> value before interpolating to get a speed up in the beginning and then slow down in the end.<br />
<span id="more-187"></span></p>
<p><center><a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/attachment/3/" rel="attachment wp-att-190"><img src="http://nklein.com/wp-content/uploads/2009/04/3.png" alt="interp-3" title="interp-3" width="362" height="332" class="size-full wp-image-190" /></a></center><br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_192613d43790f7f6d1a03b285815852a.png" title="t' = 3t^2 - 2t^3" style="vertical-align:-20%;" class="tex" alt="t' = 3t^2 - 2t^3" /></center></p>
<p>I might like to decelerate faster than I accelerate though so I might employ a fancier (higher-order) polynomial like:</p>
<p><center><a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/attachment/4/" rel="attachment wp-att-189"><img src="http://nklein.com/wp-content/uploads/2009/04/4.png" alt="interp-4" title="interp-4" width="362" height="332" class="size-full wp-image-189" /></a></center><br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_56e7a6a5cab5289a0fbe06302ed04c7b.png" title="t' = \frac{1}{2}t^2 + 6t^3 - \frac{17}{2}t^4 + 3x^5" style="vertical-align:-20%;" class="tex" alt="t' = \frac{1}{2}t^2 + 6t^3 - \frac{17}{2}t^4 + 3x^5" /></center></p>
<p>But, in this case, I wanted the tile to overshoot the target a bit and then nestle/wiggle into place.  So, I experimented with a bunch of different polynomials.  I was having real trouble getting them to behave in a way that felt right.  So, I went back to the physics of it.</p>
<p>What I wanted was pretty similar to damped spring motion.  Imagine you&#8217;ve tied a heavy weight to a spring and suspended it all in a jar of oil.  If you perturb the weight, it will bounce up and down but<br />
each bounce is closer to the equilibrium point than the previous bounce. (Actually, it&#8217;s more complicated than that.  If the spring is too weak or the oil too viscous, the weight will just slowly return to the equilibrium point without ever going past it.  That&#8217;s called <q>overdamped</q> harmonic oscillation.  What I want is called <q>underdamped</q> harmonic oscillation and that&#8217;s all I will concern myself with here.)  The equation for this motion is:</p>
<p><center><a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/attachment/1/" rel="attachment wp-att-188"><img src="http://nklein.com/wp-content/uploads/2009/04/1.png" alt="interp-1" title="interp-1" width="362" height="332" class="size-full wp-image-188" /></a></center><br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_183e283439724e2d53461f2d35e45c55.png" title="e^{-kt}\cos(\omega t + \phi)" style="vertical-align:-20%;" class="tex" alt="e^{-kt}\cos(\omega t + \phi)" /></center></p>
<p>To get it to wiggle an appropriate amount, I was using <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_09e765cf1309e741b7d63896b0e5f131.png" title="\omega = 4\pi" style="vertical-align:-20%;" class="tex" alt="\omega = 4\pi" /> and <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_0ecb976ae09df37ce3eb04c2e5476ee1.png" title="\phi = -\frac{\pi}{2}" style="vertical-align:-20%;" class="tex" alt="\phi = -\frac{\pi}{2}" /> effectively making the cosine into a sine.</p>
<p>This is all well and good, but to really scale my t, I need this to start at zero and approach one.  So, I was really using:</p>
<p><center><a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/attachment/2/" rel="attachment wp-att-193"><img src="http://nklein.com/wp-content/uploads/2009/04/2.png" alt="interp-2" title="interp-2" width="362" height="332" class="size-full wp-image-193" /></a></center><br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_c6b4c32d153a59887d18aa66851ee824.png" title="t' = t + e^{-kt}\sin(\omega t)" style="vertical-align:-20%;" class="tex" alt="t' = t + e^{-kt}\sin(\omega t)" /></center></p>
<p>Well, now it starts zig-zagging on the way to its destination.  It already starts cutting back long before it makes it to where it&#8217;s going.  I needed to get close to the destination much sooner.  So, I jiggered the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> term:</p>
<p><center><a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/attachment/8/" rel="attachment wp-att-194"><img src="http://nklein.com/wp-content/uploads/2009/04/8.png" alt="interp-8" title="interp-8" width="362" height="332" class="size-full wp-image-194" /></a></center><br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_ea300b9cde964c1f248728a4e8518ef3.png" title="t' = 1 - (1-t)^4 + e^{-kt}\sin(\omega t)" style="vertical-align:-20%;" class="tex" alt="t' = 1 - (1-t)^4 + e^{-kt}\sin(\omega t)" /></center></p>
<p>This looks terrible though.  I hit the destination is less than a tenth of a second and then not again until about half a second.  The reason for this is that the oscillations happen at a fixed rate.  <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_0824a1fdf135170467671326d5780e2b.png" title="\omega" style="vertical-align:-20%;" class="tex" alt="\omega" /> never changes and <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> moves steadily along so that <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_0ce8d212a10d8619e00e43a97ce75527.png" title="\sin(\omega t)" style="vertical-align:-20%;" class="tex" alt="\sin(\omega t)" /> keeps the same frequency throughout my interval.  So, I jiggered the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> going into the sine function to make my oscillations start out slowly and really speed up toward the end.</p>
<p><center><a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/attachment/5/" rel="attachment wp-att-195"><img src="http://nklein.com/wp-content/uploads/2009/04/5.png" alt="interp-5" title="interp-5" width="362" height="332" class="aligncenter size-full wp-image-195" /></a></center><br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_d206dd1b8a9975dac7a20d2f485d302c.png" title="t' = 1 - (1-t)^4 + e^{-kt}\sin(\omega t^8)" style="vertical-align:-20%;" class="tex" alt="t' = 1 - (1-t)^4 + e^{-kt}\sin(\omega t^8)" /></center></p>
<p>This is much better, but it still didn&#8217;t give the feeling of settling in because the second oscillation was almost as high as the first.  I could up the value of <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_98d86ac06986d02b6e40f483093b61e0.png" title="k" style="vertical-align:-20%;" class="tex" alt="k" /> and get somewhere.  But, I wanted it to be even more dramatic.  So, I changed the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> in the exponent to <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2dfd71f3d0d6caca184676440dd9f788.png" title="t^3" style="vertical-align:-20%;" class="tex" alt="t^3" /> (and used a slightly higher <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_98d86ac06986d02b6e40f483093b61e0.png" title="k" style="vertical-align:-20%;" class="tex" alt="k" />: was 3 and is now 4):</p>
<p><center><a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/attachment/6/" rel="attachment wp-att-196"><img src="http://nklein.com/wp-content/uploads/2009/04/6.png" alt="interp-6" title="interp-6" width="362" height="332" class="size-full wp-image-196" /></a></center><br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_ab2071d4a434e9ab5ec3479bb94847f3.png" title="t' = 1 - (1-t)^4 + e^{-kt^3}\sin(\omega t^8)" style="vertical-align:-20%;" class="tex" alt="t' = 1 - (1-t)^4 + e^{-kt^3}\sin(\omega t^8)" /></center></p>
<p>This was pretty decent, but I felt the initial attack was a bit strong.  So, I dropped down the exponent on my base curve from 4 to 2:</p>
<p><center><a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/attachment/7/" rel="attachment wp-att-197"><img src="http://nklein.com/wp-content/uploads/2009/04/7.png" alt="interp-7" title="interp-7" width="362" height="332" class="size-full wp-image-197" /></a></center><br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_91b53d4e338118fb129365a6a9871631.png" title="t' = 1 - (1-t)^2 + e^{-kt^3}\sin(\omega t^8)" style="vertical-align:-20%;" class="tex" alt="t' = 1 - (1-t)^2 + e^{-kt^3}\sin(\omega t^8)" /></center></p>
<p>This is pretty nice.  It looks pretty natural (despite making an entire mess out of damped harmonic motion).  It doesn&#8217;t ease in at all though so I might still need to replace the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2440a4af622544eadc0e1791b4221865.png" title="1 - (1-t)^2" style="vertical-align:-20%;" class="tex" alt="1 - (1-t)^2" /> with something of a higher order.  But, I might not mind the tile achieving instant velocity.  It gives it that <q>I&#8217;m really supposed to be over there</q> sort of urgency.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

