Finding a parabola through two points with given slopes
The Wikipedia article on modern triangle geometry has an image labled “Artzt parabolas” with no explanation.
A quick search didn’t turn up anything about Artzt parabolas [1], but apparently the parabolas go through pairs of vertices with tangents parallel to the sides.
The general form of a conic section is
ax² + bxy + cy² + dx + ey + f = 0
and the constraint b² = 4ac means the conic will be a parabola.
We have 6 parameters, each determined only up to a scaling factor; you can multiply both sides by any non-zero constant and still have the same conic. So a general conic has 5 degrees of freedom, and the parabola condition b² = 4ac takes us down to 4. Specifying two points that the parabola passes through takes up 2 more degrees of freedom, and specifying the slopes takes up the last two. So it’s plausible that there is a unique solution to the problem.
There is indeed a solution, unique up to scaling the parameters. The following code finds parameters of a parabola that passes through (xi, yi) with slope mi for i = 1, 2.
def solve(x1, y1, m1, x2, y2, m2):
Δx = x2 - x1
Δy = y2 - y1
λ = 4*(Δx*m1 - Δy)*(Δx*m2 - Δy)/(m1 - m2)**2
k = x2*y1 - x1*y2
a = Δy**2 + λ*m1*m2
b = -2*Δx*Δy - λ*(m1 + m2)
c = Δx**2 + λ
d = 2*k*Δy + λ*(m1*y2 + m2*y1 - m1*m2*(x1 + x2))
e = -2*k*Δx + λ*(m1*x1 + m2*x2 - y1 - y2)
f = k**2 + λ*(m1*x1 - y1)*(m2*x2 - y2)
return (a, b, c, d, e, f)
[1] The page said “Artz” when I first looked at it, but it has since been corrected to “Artzt”. Maybe I didn’t find anything because I was looking for the wrong spelling.
The post Finding a parabola through two points with given slopes first appeared on John D. Cook.
