<story><title>Psy Curve</title><url>http://www.wolframalpha.com/input/?i=PSY+curve</url><text></text></story><parent_chain><item><author>damian2000</author><text>Wonder how this was generated - surely not by hand? Is there a way of taking a set of splines or similar and creating equations from them, like this?</text></item></parent_chain><comment><author>yk</author><text>Yes, in the case of splines you have this by definition.[1] If you want a algorithm for generating formulas from pixel graphics ( with nice properties), then you can&lt;p&gt;1. Separate the graphics into distinct line segments. 
2.  Take from each line segments a few points and do a (cubic) interpolation of the line segment.
3. Cut the line segment into two half, and redo 2. if you are not satisfied by the lines.&lt;p&gt;If you look at the formula, then you will see that something quite similar happens. The formula is always a sum of several sines, times two Heavyside step functions. [2]
The trick here is, that the product of two Heavyside functions will give you a function that is one for some interval and zero otherwise. Effectively switching off the part of the sum outside of the interval. And the sum of sines is essentially a Fourier transform of the line drawn.&lt;p&gt;[1]&lt;a href=&quot;https://en.wikipedia.org/wiki/Spline_%28mathematics%29&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Spline_%28mathematics%29&lt;/a&gt;&lt;p&gt;[2]&lt;a href=&quot;https://en.wikipedia.org/wiki/Heaviside_step_function&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Heaviside_step_function&lt;/a&gt;</text></comment>
<story><title>Psy Curve</title><url>http://www.wolframalpha.com/input/?i=PSY+curve</url><text></text></story><parent_chain><item><author>damian2000</author><text>Wonder how this was generated - surely not by hand? Is there a way of taking a set of splines or similar and creating equations from them, like this?</text></item></parent_chain><comment><author>ntumlin</author><text>And is there a way to create other stuff like this? It would be neat to be able to draw some simple thing with your mouse on a canvas and then have it generate an equation that makes it.</text></comment>