<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: Generating Bézier curves from discrete point sets</title>
      <link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets/</link>
      <description>Comments on Ask MetaFilter post Generating Bézier curves from discrete point sets</description>
	  	  <pubDate>Thu, 09 Nov 2006 14:05:14 -0800</pubDate>
      <lastBuildDate>Thu, 09 Nov 2006 14:05:14 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: Generating B&#xe9;zier curves from discrete point sets</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets</link>	
  	<description>What is a good algorithm for generating smooth curves from discrete points? &lt;br /&gt;&lt;br /&gt; For example, I have a set of time series data.  I can easily draw a jagged line by plotting each point and connecting with straight lines.  However, I&apos;d like to make a pretty graph with smooth, interpolated lines using cubic or quadratic B&#xe9;zier curves.&lt;br&gt;
&lt;br&gt;
I&#8217;ve looked over the &lt;a href=&quot;http://archive.dojotoolkit.org/nightly/tests/charting/test_engine.html&quot;&gt;Dojo Charting Engine&lt;/a&gt;, which does pretty much what I want, simply calculating the delta along the X-axis, and multiplying by a constant &#8220;tension&#8221; factor to determine the position of the control points.&lt;br&gt;
&lt;br&gt;
Can you point me to any other, similar algorithms?</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.50554</guid>
  	<pubDate>Thu, 09 Nov 2006 13:56:26 -0800</pubDate>
  	<dc:creator>ijoshua</dc:creator>
	
	<category>bezier</category>
	
	<category>curve</category>
	
	<category>points</category>
	
	<category>charting</category>
	
	<category>chart</category>
	
	<category>graphing</category>
	
	<category>graph</category>
	
	<category>math</category>
	
</item>
<item>
  	<title>By: vacapinta</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets#766089</link>	
  	<description>You should read up on &lt;a href=&quot;http://www.google.com/search?hl=en&amp;lr=&amp;q=splines&amp;btnG=Search&quot;&gt;Splines&lt;/a&gt;.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.50554-766089</guid>
  	<pubDate>Thu, 09 Nov 2006 14:05:14 -0800</pubDate>
  	<dc:creator>vacapinta</dc:creator>
</item>
<item>
  	<title>By: Neiltupper</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets#766099</link>	
  	<description>Take a look at &lt;a href=&quot;http://curveexpert.webhop.biz/&quot;&gt;CurveExpert.&lt;/a&gt; It&apos;s shareware with a 30 day evaluation period.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.50554-766099</guid>
  	<pubDate>Thu, 09 Nov 2006 14:11:30 -0800</pubDate>
  	<dc:creator>Neiltupper</dc:creator>
</item>
<item>
  	<title>By: dseaton</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets#766198</link>	
  	<description>Do you have access to Mathematica?  If so, you can use the Interpolation command.  It works pretty well for what you want.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.50554-766198</guid>
  	<pubDate>Thu, 09 Nov 2006 15:27:19 -0800</pubDate>
  	<dc:creator>dseaton</dc:creator>
</item>
<item>
  	<title>By: bonehead</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets#766243</link>	
  	<description>If you don&apos;t know the functional form of your data, a spline fit (see above) is often the &amp;quot;best&amp;quot; answer. &lt;a href=&quot;http://en.wikipedia.org/wiki/B%C3%A9zier_spline&quot;&gt;B&amp;eacute;zier &amp;quot;curves&amp;quot;&lt;/a&gt; are a form of splines. the trick to fitting splines is boundary conditions: if you don&apos;t get the derivatives right at the ends you sometimes end up with really weird curves (You didn&apos;t know you were doing calculus in Photoshop when you were tweaking nodes, now did you?)&lt;br&gt;
&lt;br&gt;
If you know a bit more about how your data should behave (no inflection points, for example), you can use a better candidate function to fit your dataset. The simplest way to do this is the linearize you data in terms of the function, &lt;em&gt;e.g.&lt;/em&gt;, if fittiing an exponential, take the log of your data, then fitting a line, doing the back transform and finally plotting. This only works for farily simple functions though (like splines). Otherwise you&apos;re stuck with a non-linear fit.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.50554-766243</guid>
  	<pubDate>Thu, 09 Nov 2006 16:06:10 -0800</pubDate>
  	<dc:creator>bonehead</dc:creator>
</item>
<item>
  	<title>By: bonehead</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets#766259</link>	
  	<description>On rethink: are you plotting data real-time, and/or don&apos;t really care about how the fit looks and just want a nice line? In that case, the cheap and nasty way to do it is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_average&quot;&gt;moving-average&lt;/a&gt; calculation, sort of the red-headed stepchild of a real spline fit. I&apos;ve found that a five-point trailing average is enough to fake out most obersevers for real-time stuff. Computationally, a moving average is way cheaper than even a spline fit.&lt;br&gt;
&lt;br&gt;
Technically, this isn&apos;t a fitting so much as a smoothing technique, but if that&apos;s what you need, it will serve much the same job.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.50554-766259</guid>
  	<pubDate>Thu, 09 Nov 2006 16:21:55 -0800</pubDate>
  	<dc:creator>bonehead</dc:creator>
</item>
<item>
  	<title>By: ijoshua</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets#766351</link>	
  	<description>Nailtupper and dseaton, thanks, but Im not looking for software to do the job for me.  Im interested in the math behind the process because Im generating dynamic charts, most likely targeting SVG.&lt;br&gt;
&lt;br&gt;
My input data most likely doesnt fit any particular functional form  its a time series of website statistics, e.g. number of active sessions per hour of a day.  It isnt a real-time plot, either.&lt;br&gt;
&lt;br&gt;
I dont think a moving average is what I want, either.  I want the line to fit the data pretty accurately, because Im only analyzing a few dozen samples (or knots, I guess) at once.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.50554-766351</guid>
  	<pubDate>Thu, 09 Nov 2006 17:47:32 -0800</pubDate>
  	<dc:creator>ijoshua</dc:creator>
</item>
<item>
  	<title>By: bonehead</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets#767725</link>	
  	<description>A last comment: if you are concerned about understanding your data trends, you may want to consider using something other (or in addition to) splines. Splines will give you a pretty picture, because splines will fit just about anything given enough nodes and boundary condition freedom. They&apos;re also quite light-weight numerically. They are very hard to interpret, however. What does the trend line mean? Splines won&apos;t tell you.&lt;br&gt;
&lt;br&gt;
If you&apos;re trying for a functional descritption of your data, you need to try other things and that typically means either tranforming your data, e.g. Fourier transforms to look for periodicity, or using non-linear functional fits. A reasonably practical starting place for both approaches are the &amp;quot;Numerical Recipies in C/C++/Fortran&amp;quot; books, if that&apos;s what you&apos;re after.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.50554-767725</guid>
  	<pubDate>Sat, 11 Nov 2006 11:16:04 -0800</pubDate>
  	<dc:creator>bonehead</dc:creator>
</item>
<item>
  	<title>By: iconjack</title>
  	<link>http://ask.metafilter.com/50554/Generating-Bézier-curves-from-discrete-point-sets#785310</link>	
  	<description>Check out these nice articles by Don Lancaster:&lt;br&gt;
http://www.tinaja.com/cubic01.asp</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.50554-785310</guid>
  	<pubDate>Wed, 29 Nov 2006 11:36:45 -0800</pubDate>
  	<dc:creator>iconjack</dc:creator>
</item>

    </channel>
</rss>
