For reasons that will become clear in a couple of posts, I wanted to be able to calculate quadratic Bézier curve parameters from a focus and horizontal directrix.
A focus and directrix are enough to define a parabola (in fact a parabola is the locus of points equidistance from a point, the focus, and a line, the directrix).
A quadratic Bézier curve is a section of a parabola and is defined by three points, according to the formula:
B(t) = (1-t)²P₀ + 2t(1-t)P₁ + t²P₂, t ∈ [0, 1]
Here's how I came to my result...
Given the directrix is horizontal,
and by definition:
Now even though somewhat arbitrary and assuming the directrix is below the focus,
for some α where (Fx, Fy) is focus and Dy is y-coordinate of directrix.
But, given P₀ and P₂ have a y-coordinate of 0 and directrix is horizontal,
And so, assuming the directrix is horizontal and below the focus, the following Bézier curve parameters can also be used to create the parabola:
The original post was in the category: mathematics but I'm still in the process of migrating categories over.