1
$\begingroup$

Step One

I need to find the equation that will describe a cartesian path that looks like the following red line:

enter image description here

Step Two

Given a constant start point $A(0, 0)$, a variable end point $B(x, y)$ and a variable percentage, I need to find a point $C(x, y)$ that is percentage distance on that line:

enter image description here

Let me know if I can provide anything to make the question more clear. Thanks for your help!

  • 0
    I think that one equation will make it much easier to find the point C based on a percentage distance. Sorry about the 'linear-algebra' tag. My options were limited since this is my first question. $T$hanks!2012-06-04

1 Answers 1

1

You can try curves of the form $y = \dfrac{x^{n}}{(\alpha-x)^m}, \text{ where $x \in [0,\alpha)$}$ The parameters $m$ and $n$ controls how steep you want your growth to be and the parameter $\alpha$ controls where you want your curve to go to infinity. Below are some such curves for different values of $m$ and $n$ with $\alpha$ fixed as $5$. enter image description here

Now given $B$ on the curve, compute the length of the curve from $A$ to $B$, the length of the curve is given by $L_B = \int_{x_A}^{x_B} \sqrt{1 + \left(\dfrac{dy}{dx} \right)^2} dx$ Similarly, compute the length of the curve till $C$ which is given as $L_C = \int_{x_A}^{x_C} \sqrt{1 + \left(\dfrac{dy}{dx} \right)^2} dx$

Say you want $C$ to be at a distance such that $\dfrac{L_C}{L_B} = \dfrac{\beta}{100}$ where $\beta$ is the $\%$ distance of $C$ on the curve from $A$ to $B$. Once you compute $L_c$ from above, find $x_c$ such that $L_C = \displaystyle \int_{x_A}^{x_C} \sqrt{1 + \left(\dfrac{dy}{dx} \right)^2} dx$

  • 0
    I think this will work what I need, thank you. It's not imperative that the path goes directly vertical after the curve and the trade-off for having one, elegant equation is definitely worth it. Now, I just need to take this over to JavaScript and get it working for what I need. I'll post the result. Thanks for your help!2012-06-04