To view this content, you need to install Java from java.com

To create new vertices, click and drag a mid point of the control polygon.

Controls:

You may turn on and off any section of the demo using the following hot keys:
b : Toggles the B-Spline Curve
f : Toggles the Four-Point Curve
c : Toggles the constant speed animation
a : Toggles the parametric animation
o: Toggle the Opti-Speed animation
j : Toggles the parametric acceleration lines
k : Toggles the constant speed acceration lines

g : Toggle the control polygon

You may control animations using:
p : pauses the whole thing
q : speed up parametric animations (white circles)
w : slow down parametric animations (white circles)
e : speed up constant animations (green circles)
r : slow down constant animations (green circles)

Example of a path with ~50% accelerations that exceed the threshold

Source code: CurveEditor

Built with Processing

Project P1, Part a.


By Devin G Hunt

Part b of Project 1 required the building of an optimized speed algorithm that could guide a dot, a simplified metaphor for a race car, around a curve - the track - at the fastest speed possible without slipping off.

Analyses of the curve and how an object would need to accelerate is crucial to solving this problem. Because the curves in program are created through multiple step of subdividing, acceleration can be computed through analysts of each point along the curve. To solve for the force from acceleration around the curve at a point, B, its two neighbors are needed. The vectors AB and BC both represent velocity. By subtracting the final velocity (BC) from the initial velocity (AB) yields the instantaneous acceleration. By applying that to Newton's second law, one can achieve the instantaneous force from acceleration, as described below.

Realizing this it is easy to visualize how a actor's motion must be modified to achieve an optimum speed without slipping.

The velocity and the acceleration that affects an actor using the implemented optimum speed algorithm is calculated on the fly. An envelope moves across the curve using two points to calculate the actors next move. In the below diagram the optimum speed algorithm is working with points A and B to compute the next location. Using the velocity vector AB a possible location is computed (vector head). The effects of an acceleration of varying magnitudes is represented by the white ring. By finding a point along the curve that lies within this ring a valid point to move the actor to can be found.

If no points ever fall within the acceleration ring the actor is moving to fast and is now skidding off the track. The algorithm avoids this by checking, recursively, if selecting a point will result in this outcome.