# Thread: Formula for describing a closed curve given 4 points

1. ## Formula for describing a closed curve given 4 points

Hello,

I think this falls under Trig, but maybe its something else.

I start at (0,0), then i am given 4 points, say, (2,0) (0,1.5) (-3,0) (0,-2) I plot a point at each of those. Then i need to draw a closed curve that intersects each point. The curve should have a bezier interpolation at each vertex.

I have written code to do this, but it also uses a closed source library to make the curve and I need to explain this mathematically and implement it myself so i can pick any point along the curve.

Thanks for any help

2. ## Re: Formula for describing a closed curve given 4 points

The bezier curve is not an interpolation curve: It only is gauranteed to go through the first and last points (if you are using a four point method).

The most basic form of an interpolating curve is the one by Lagrange which just finds the simplest polynomial to go through the points.

You can solve the Lagrange polynomial by setting up a linear system of equations and then finding the coeffecients by reducing the system (or you can use alternative formulas to do what amounts to the same thing).

3. ## Re: Formula for describing a closed curve given 4 points

thanks for the help chiro,

I have been looking at lagrange and i dont see any way of giving it ordered pairs, so i dont see how it can create a closed curve as it seems to progress along the X axis. Am I missing something?