0
$\begingroup$

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$.

Thanks.

  • 1
    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?2011-03-06

2 Answers 2

0

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.

  • 0
    $LaTeX$ help, please: how do I get a big vertical bar for evaluating the integral result at $x_1$ and $x_2$?2011-03-06
  • 0
    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$.)2011-03-07
  • 0
    @Rahul: Works great. Thanks. Forgot the slash on $\LaTeX$ and too late to fix now.2011-03-07
  • 0
    Thanks. Comparing your equation with that of Beta, I think you misplaced the closing bracket of ln funcion. Please verify.2011-03-07
  • 0
    @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.2011-03-07
1

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).

  • 0
    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.2011-03-07
  • 0
    @Beta: Thanks for the reply.2011-03-07
  • 0
    @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. Thanks2011-03-07