spline curve in Java
I need to use a cubic B-spline curve but cannot find code for it anywhere. The only curves available in Java API are QuadCurve2D
, Path2D
and CubicCurve2D
. I think they all are Bezier, but I'm not sure about it.
If you know where can I find code for cubic B-spline preferably that extends Java Shape
class and supports contains(Point p)
for onMouseOver
please help.
Apache has a class to represent spline curves:
http://jmeter.apache.org/api/org/apache/jmeter/visualizers/Spline3.html
However, it doesn't extend Shape or support what you want. The class works by interpolating the curve between nodes with a cubic curve. For contains(Point P) You might be able to use the getPlots() method, compare its results to the x and y values of P.
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.
链接地址: http://www.djcxy.com/p/49216.html上一篇: 多屏幕系统中C鼠标光标位置
下一篇: Java中的样条曲线