# Formula to show square root between 2 values

Bear with me - it's been a while since I did this at school!

I need to plot a curve in the form of a square root (kind of an 'r' shape if you will)

I have 6 intervals along my x axis, and my maximum y value can be 180. Given a value of x, how can I work out my value of y?

Many thanks

-
Could you supply the data? –  Raskolnikov Dec 8 '11 at 11:37
There isn't any data per se, I just want a quadrant between the values supplied, a bit like bellabathrooms.co.uk/media/catalog/product/cache/1/image/… –  Jeepstone Dec 8 '11 at 11:40
So, if I understand your question correctly, you are actually asking: "How do I draw an r shape or a $\sqrt{\phantom{r}}$ shape from a mathematical function?". –  Raskolnikov Dec 8 '11 at 11:42

If I understand well your question, you want a function that returns a 'r' like shape between $0$ and $x_{max}$ and in a range from $0$ to $y_{max}$.

To do so you can just use: $$y(x) = \frac{\sqrt{x}}{\sqrt{x_{max}}}*y_{max}$$

Here your $y_{max}=180$ so you can use: $$y(x) = \frac{\sqrt{x}}{\sqrt{x_{max}}}*180$$

This should give you the shape you expect.

Here (see comments) are the plots for different functions shaped like you asked.

-
Perfect, this is for a progress bar on a website (I kid you not). The person responsible wants the progress to appear to start off quickly and slow down (as it'll mean the user is more encouraged to enter data on a form). I bit like when Windows says "98% complete" for a very long time. Thanks very much! –  Jeepstone Dec 8 '11 at 11:52
Oh god! The curve is too steep at the start!!!!!!!!!!! #slitswrist –  Jeepstone Dec 8 '11 at 11:57
@Jeepstone: You should have said from the very start what the use of this function would have been. A square root function is definitely not appropriate since the steepness at the start is infinite. But there are many other functions that could be useful. –  Raskolnikov Dec 8 '11 at 12:02
@Jeepstone Yes you should have told us. You can use a sine function like this if you want: $$\sin(\frac{x}{2*x_{max}}*\pi))*y_{max}$$ You have an example comparing the square root function, the sine function and a "circle shaped like" function with $x \in [0;6]$ and $y\in[0;1]$ here: tinyurl.com/77dwbxa –  ReV Dec 8 '11 at 12:07
@ReV That's much better, (apparently). Thanks very much. –  Jeepstone Dec 8 '11 at 12:19