-1
$\begingroup$

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

  • 0
    Could you supply the data?2011-12-08
  • 0
    There isn't any data per se, I just want a quadrant between the values supplied, a bit like http://www.bellabathrooms.co.uk/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/a/q/aquadart-900-x-760-offset-quadrant-shower-tray-lh_1.gif2011-12-08
  • 0
    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?".2011-12-08

1 Answers 1

1

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.

  • 0
    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!2011-12-08
  • 0
    Oh god! The curve is too steep at the start!!!!!!!!!!! #slitswrist2011-12-08
  • 1
    @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.2011-12-08
  • 0
    @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: http://tinyurl.com/77dwbxa2011-12-08
  • 0
    @ReV That's much better, (apparently). Thanks very much.2011-12-08
  • 0
    You are welcome. Don't hesitate to ask for more details if needed.2011-12-08