All right, couple of things...
- You can't make a curve with 2 points. You need at least 4 points. See the reference for curveVertex. With 4 points, the curve will go from point 2 to point 3, where point 1 and point 4 are the control points. What the curve looks like will depend on all these 4 points.
- Notice how the drawShape() in my example is exactly the same as the drawDataLine() in your code. The only difference is that I explicitly add the control points at the beginning and end, while you repeat the first and last point with lines 12-14 (which is basically the same thing).
- Notice further that in my example a point moves smoothly over the whole curve. I am getting this point on the curve with the aptly named function curvePoint(). So in this example it is hopefully clear that this function can in fact deliver you the interpolated point on a curve.
- To get the interpolated x and y on the curve via the curvePoint function, you indeed need 4 points (because a curve requires at least 4 points). curvePoint does not give some random fifth or next point. Instead, for the range 0-1 it gives an interpolated point on the curve.
- In your drawDataLine() function you apparantly go over a number of points (colCount) out of which you construct a curve using beginShape-curveVertex-endShape. My advice is to seperate the getting of the data from the drawing of the data. So in one function get all the points and put them into an array or arraylist. Then you will have a list of points, just like I had in my example. Once you have a list of point you can either use those points to draw a curve shape (drawShape function), display those points (drawPoints function) or draw an interpolated point somewhere on the curve (drawCurvePoint function).
Hopefully this clears some things up. If you want further code assistance with your own project, consider posting the whole project somewhere or at least a runnable code example that you feel represents your specific problem.
NOTE: There is a typo in the curvePoint reference. Currently it says "a and d are points on the curve, and b and c are the control points" while it should say (the other way around) "b and c are points on the curve, and a and d are the control points".