I initially thought I could figure out this math on my own, but...I'm stumped.
Attached is a picture illustrating the object of my frustration. Explanations:
The location of the rightmost circle, referred to as "thisPoint," always rests at a randomly generated location. The actual point rests at the epicenter of the circle, while the diameter of each circle is equal to the thickness of the pen stroke being simulated -- this holds true for all circular representations.
The location of the second-leftmost circle, referred to as "lastPoint," always assumes the previously generated location of thisPoint.
The location of the second-rightmost circle, referred to as "thisControl," always resides at: thisPoint.x - (dX / 3), thisPoint.y - (dY / 3).
(where d(N) = thisPoint.(n) - lastPoint.(n)).
In other words, thisControl always rests on the slope between lastPoint and thisPoint, aiming toward lastPoint.
The leftmost circle is an approximation of the last known location of lastPoint. In this context, lastPoint serves as a representation of the last known location of thisPoint.
The third-leftmost circle, referred to as "lastControl," always assumes the inverse of thisControl's last known rise and run -- relative to the last known location of thisPoint -- multiplied by the quotient of the newly established hypotenuse between lastPoint and thisPoint divided by three.
The radius between thisPoint and thisControl is also equal to one third of the newly established hypotenuse.
The third-rightmost circle, referred to as "halfwayPoint," always rests halfway along the slope between lastControl and thisControl, facilitating the "two halves" method required to approximate Beziér Curves in Flash's drawing API.
All the red dots indicate vertices of the spline that must be drawn to create the filled region.
Knowns:
The location of the vertices at lastPoint, halfwayPoint, and thisPoint are known.
Unknowns:
The location of the vertices at lastControl and thisControl are unknown and must be solved.
I'm stumped. The reason it's so hard to solve is it isn't just a Beziér. It's two splines on either side of the initial curve that (for all practical purposes) lie in parallel to it.
I know you haven't solved for the verticies yet, but still... wouldn't you rather use cubic regression instead of a cubic spline so that the curve will actually go through all four points and there won't be any need for solving for control points.
So you have been trying to solve Bezier equations directly?
Is there some reason why you can't find the coordinates of the unknown vertices by geometry? A tiny bit of vector maths and trigonometry looks like all is needed, unless this is part of some bigger problem.