Cubic Bezier Y at X

One of the requests for the Singularity Bezier curves is the ability to return a y-value, given an x-value. This is often used for interpolation in easing. Many 3D packages, for example, have the ability to specify a functional relationship between two parameters using a cubic Bezier curve as a visual design tool. The problem is not trivial in the general sense as cubic Beziers do not generally map x->y one-to-one. The curve might loop around on itself (self-intersecting) or bend in a manner so that there may be more than one y-value for a single x-coordinate.

This request is on the development list for the parametric curve library, but I also want to point out that Flash CS3 users have access to the fl.motion package. There is a BezierSegment class (representing a single cubic Bezier curve with four control points) in that package. The BezierSegment class contains a getYForX() method.

Advertisement

One thought on “Cubic Bezier Y at X

Comments are closed.