I received a couple questions regarding this post relative to computing the angle of the tangent line relative to the horizontal. It’s a matter of a little trig once you recall the geometric interpretation of a curve’s derivative at a point. Our old friend, Math.atan2() is just what the doctor ordered. To illustrate, I modified the demo code to use the Singularity Wedge class to show the angle relative to the horizontal as shown below.
The wedge is redrawn dynamically as the slider moves. Once you know the tangent orientation, you also know the normal orientation. Along with arc-length parameterization, this means that sprites can be precisely distributed along and aligned to the spline. Stay tuned for more …

Subscribe
I wish I had a demo like this when I was taking calculus
By: JT on September 16, 2008
at 11:32 am
[...] AS3, Geometry, normal, spline, tangent trackback Once again, there were a few questions regarding this post; namely, how to draw the normal vector to the spline. One person suggested using the fact that [...]
By: Spline Tangents Part III « The Algorithmist on September 17, 2008
at 6:32 am