curvefitting.sourceforge.net looks like it may be suitable. It offers a variety of methods (cubic spline, polynomial etc).
+1
A:
Brian Agnew
2009-05-18 15:10:16
I found that one too, but the documentation is all in german, and the source code isn't provided.
Russell Leggett
2009-05-18 15:21:12
I'd hope the source code *is* provided, since it's on Sourceforge. Have you looked at the source code repository ?
Brian Agnew
2009-05-18 15:24:52
one would think, but I browsed cvs and there are no files there
Russell Leggett
2009-05-18 15:28:59
It's in the .jar file. Doesn't appear to be in the CVS repository though :-(
Brian Agnew
2009-05-18 15:29:06
Sorry. Just saw your additional comment re. CVS. Can't help you on the German, but I'd hope (!) the Java is relatively clear
Brian Agnew
2009-05-18 15:30:06
ah, so it is. wasn't expecting that!
Russell Leggett
2009-05-18 15:43:41
A:
I've never done it, but a quick Google search revealed that Bezier curves are implemented in http://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/QuadCurve2D.Double.html
Then, you can getPathIterator() from this curve and with that, according to what documentation says, you get the "coordinates of shape boundaries", which, i suppose, is what you are looking for.
zilupe
2009-05-18 15:18:56
No, he does not want to do this. He needs to compute control points of the curve using spline interpolation or some heuristics method.
Matej
2009-05-19 07:25:12
I suggest you better read http://en.wikipedia.org/wiki/Spline_(mathematics) and http://en.wikipedia.org/wiki/B%C3%A9zier_curveBezier curves is one of the ways to model these curves. By having the coordinates of points on this curve, he effectively gets what he wants.
zilupe
2009-05-19 07:43:12
A:
After more searching into splines, I found this little bit of Java code for doing them in an applet. The source is provided and looks pretty straightforward. I should be able to adapt it to my needs. It is especially nice because the cubics it generates are objects I can easily use for my own needs and separate it from the paint function.
Thanks "lambert"!
Russell Leggett
2009-05-19 17:05:27