Cubic B-spline curve in Java

I need to use a cubic B-spline curve, but cannot find the code for it anywhere. The only curves available in the Java API are QuadCurve2D , Path2D and CubicCurve2D . I think they are all Beziers, but I'm not so sure.

If you know where I can find the code for a cubic B-spline, preferably one that extends the Java Shape class and supports contains(Point p) for onMouseOver , please help.

+7
java graphics
source share
2 answers

Apache has a class for representing curve splines:

http://jmeter.apache.org/api/org/apache/jmeter/visualizers/Spline3.html

However, it does not extend the form or support what you want. A class works by interpolating a curve between nodes with a cubic curve. For contains (Point P) Perhaps you can use the getPlots () method, compare its results with the x and y values ​​for P.

+1
source share

CubicCurve2D is a cubic B-spline.

However, this may or may not be what you need, as there are other cubic B-splines.

That is, all CubicCurve2Ds are cubic B-splines. Not all cubic B-splines are CubicCurve2Ds.

+3
source share

All Articles