tags:

views:

70

answers:

1

Are there methods for evaluating cubic or quadratic Java2D curves at a given time t? I know the algorithm is simple, but I would suspect that there is a method for that already in Java.

+1  A: 

For whatever reason, they made all of that stuff private. But (and you may already know this) the QuadCurve2D (and CubicCurve2D) source is all there for you to read in the SDK, and it has all of the t-wise code within.

Jonathan Feinberg
It's strange indeed that they don't expose that.
Torsten Marek
Well, they didn't want to make any API-level guarantees about implementation details. For example, what if they wanted to do some sneaky JNI stuff in some future implementation to speed up curve rendering?
Jonathan Feinberg