New Quad. Bezier Methods
When using Bezier curves to approximate trajectories in path animation, it can be useful to query extreme points. This query can be used, for example, to test if an auto-generated path between two points exceeds a bound. For quadratic Beziers, there are three critical points in [0.1]; the endpoints and a possible third point where the derivative is zero. Four methods, tAtMinX(), tAtMaxX(), tAtMinY(), and tAtMaxY() were added to the IParametric Interface, although the only concrete implementation is currently for Bezier2.
The following screen shot illustrates an example of a quad. Bezier trajectory auto-generated between two endpoints. The red Knots indicate maximum y-value (y-down is positive in Flash) and the green Knots indicate minimum y-value.
In this case, tAtMinY() indicates the parameter value at the top of the trajectory from the point of view of the user. The Bezier2 class also has a working implementation of toString(), although some thought is required as to how it should be implemented for arbitrary parametric curves. The usual work in progress 🙂
As always, Singularity can be downloaded here. Experiment and have fun!