I am working on a control algorithm to be run on an embedded system. My programming language is C and the system will be pretty tightly constrained in terms of memory and processing power.
I have a few (in the order of about 10) reference points in three dimensional space. These are normally static, but will change once in a while. I would like to fit a spline surface so that it passes though all of these points, and then have a function which for a given input vector (x, z) returns distance y from the plane y = 0.
I think this is a problem that needs to be solved in two parts: 1) some new coefficients will be calculated whenever a reference point changes and 2) the coefficients are plugged into a function which returns y for a given (x, z). (Only 2 needs to happen 'real time'.)
I have researched on the net this a bit but am having a hard time with the math, and a lot of the material is specific to computer graphics. I am not even sure what type of spline I need; NURBS and Catmull-Rom both seem to be relevant. Lastly, regarding the shape of the edges of my spline: As my input vectors are from well bounded sensor readings, I don't really care what the spline does outside of that boundary.
I would be very grateful for some help or pointers to relevant material, and any snippets of pseudo code would be much appreciated.