Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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!

share|improve this question
1  
Do you require a single equation for the curve $A,C,B$? I mean could it be e.g. 3 equations, two of which would be $y=y_A=0$ (horizontal line) and $x=x_B$ (vertical line)? Why the (linear-algebra) tag? –  Américo Tavares Jun 2 '12 at 0:16
    
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. Thanks! –  Wigz Jun 4 '12 at 17:00

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
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! –  Wigz Jun 4 '12 at 17:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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