## Saturday, July 13, 2013

### Constructing a smooth curve from a set of points geometrically

Suppose you start with a set of points and you know the order they should be connected...
The first step of this method is to construct arcs between each set of 3 consecutive points in the geometrical sense.  Here I've done the first 3 points...
Doing each set of 3 consecutive points gives...

Now the next step is to place new points in the centroids of any enclosed areas like so...
Now all the arcs currently drawn can be deleted...
And the process reiterates... more arcs are drawn for every 3 consecutive points...
And then once again a point is placed for each centroid, and more arcs are drawn, here is where we are after 3 iterations...
As you can see the overall path becomes smoother and smoother.
It can go on forever or a certain number of iterations.

**EDIT**
Ofnuts from the gimp forum asked me a good question about how many iterations would be necessary... On a computer screen with pixels you would need to go log_2(pixel arc length) iterations.  The pixel arc length is the number of pixels in the final curve. An upper bound for the pixel arc length is the pixel length of the circular arcs placed in the first iteration.This is because the number of pixels you have placed doubles each iteration and the final curve fits inside of the first iterations arcs.