Given two points $A =(x_1,y_1)$, $B = (x_2,y_2)$ and length $L$, how do I plot a parabolic segment of length $L$ that connects A and B? The vertex of the parabola $(p, \, q)$ should be such that $x_1 \leq p \leq x_2$ and $q \leq y_1, y_2$.

In other words, I need to draw a parabolic segment connecting $A$ and $B$ with length $L$ that looks like a 'U' shape, with the vertex being below $A$ and $B$.


  • 1
    $\begingroup$ You'll need three points to uniquely define a parabola -- there's an infinite number of concave-up parabolas passing through just two points. Can you restrict the parabola further? $\endgroup$ – haldean Mar 6 '11 at 20:53

To amplify Beta's answer, if you write the equation as $y=a(x-b)^2+c$ the fact that the two points need to be on the parabola gives two equations in $a,b,c$. Your constraints on the vertex become constraints on $a, b$ and $c$. The arclength from $x_1$ to $x_2$ is $L=\left.\frac{1}{2a}\sqrt{1+4a^2(x-b)^2}+\frac{1}{2}\ln\left(2a(x-b)+\sqrt{1+4a^2(x-b)^2}\right)\right|_{x_1}^{x_2}$ and this is a third equation in $a$ and $b$. It looks like you are into a numeric solution, but you do have enough constraints.

  • $\begingroup$ $LaTeX$ help, please: how do I get a big vertical bar for evaluating the integral result at $x_1$ and $x_2$? $\endgroup$ – Ross Millikan Mar 6 '11 at 23:12
  • $\begingroup$ Try \left. a^{b^c}_{d_e} \right\rvert_{x_1}^{x_2}, which renders as $\left. a^{b^c}_{d_e} \right\rvert_{x_1}^{x_2}$. (P.S. Also, I have to recommend using \LaTeX to get $\LaTeX$ instead of $LaTeX$.) $\endgroup$ – Rahul Mar 7 '11 at 0:04
  • $\begingroup$ @Rahul: Works great. Thanks. Forgot the slash on $\LaTeX$ and too late to fix now. $\endgroup$ – Ross Millikan Mar 7 '11 at 0:09
  • $\begingroup$ Thanks. Comparing your equation with that of Beta, I think you misplaced the closing bracket of ln funcion. Please verify. $\endgroup$ – Vijay Krishna Mar 7 '11 at 5:06
  • $\begingroup$ @Vijay: you are right, but I took mine from Beta's, then edited Beta's post to put the $\LaTeX$ in. So you should check it, though the corrected version fits my general feel for integrals. $\endgroup$ – Ross Millikan Mar 7 '11 at 5:13

Suppose we have a parabola defined by $y = a x^2$, with $a \gt 0$. Now we want to know its length between $x_1$ and $x_2$.

$\begin{align} L &= \int dl \\ &= \int \sqrt{dx^2 + dy^2} \end{align}$

$y = a x^2$

$dy = 2 a x dx$

$\begin{align} L &= \int \sqrt{dx^2+ (2 a x dx)^2} \\ &= \int dx \sqrt{1+ (2 a x)^2} \end{align}$

Now we look in a table of integral rules:
$\int \sqrt{1 + (kx)^2} = \frac{1}{k} \sqrt{1 + k^2x^2} + \frac{1}{2} \ln\left(kx + \sqrt{1 + k^2x^2}\right) + C$

Now comes the hard part: given x1, x2 and L, solve for a. This looks like a trancendental equation and offhand I don't see any clever way to solve it analytically. So you'll have to solve it numerically. A simple loop of code should do it; L increases strictly with a.

Shifting to the desired x1, x2, y1 and y2 is trivial (but notice that the problem appears to be underconstrained).

  • $\begingroup$ To enter equations, you enclose $\LaTeX$ between dollar signs. You can right click on any of that and choose Show Source to see how it was done. I hope I didn't do violence to your meaning when I formatted it. $\endgroup$ – Ross Millikan Mar 7 '11 at 0:10
  • $\begingroup$ @Beta: Thanks for the reply. $\endgroup$ – Vijay Krishna Mar 7 '11 at 5:05
  • $\begingroup$ @Beta: I made a correction based on Vijay's comments, but you are the one who checked the integral tables. Please make sure I got it right. Thanks $\endgroup$ – Ross Millikan Mar 7 '11 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.