excel function. I copied the formula =sin($G$2*b2) in c2 right down to c102.
Basically i wanted to be able to fit exactly, any number of cycles of the sine wave to any point on the y axis. So if I want, say 4 cycles going from y=0 to y=2. The 4 cycles would be stretched so that the last cycle would cross the y axis (in this case y=100) where x=0. Since I was using the formula sin(p*x) to work out y, i thought I could just transpose the formula to make p the subject and that would give me the value to multiple x to fit the 4 cycles between the 0 to 100 points on the y axis.
I don't even know if that makes sense.
The question is very fuzzy. First, I am not sure what YOU mean by cycle. Is it the function starts at 0, goes to plus 1, then goes to 0, then goes to minus 1, and finally goes to 0. Or is it the function starts at 0, goes to 1, and then goes to 0. The standard meaning of a cycle is the first of these.
Second, y = 0 to y = 2 and y = 100 makes no sense at all.
Third, the standard way of showing the sine function would be y = sin(x), and so y would range from minus 1 to plus 1. If you want the maximum value of y to be a and the minimum to be b, the function you are looking for is
\(\displaystyle \dfrac{a - b}{2} * \left(sin(something) + 1\right) + b = \dfrac{(a - b) * sin(something)}{2} + \dfrac{a - b}{2} + b =
\dfrac{(a - b) * sin(something) + a + b}{2}.\)
Notice that if b = - a the formula simplifies to \(\displaystyle a * sin(something).\)
Fourth, if you want four cycles from x = to x = 4, you want one cycle from x = 0 to x = 1. You can get that with
\(\displaystyle sin(something) = sin(2 \pi x).\)
In general if the first cycle starts at x = 0 and ends at x = a > 0, then the formula is \(\displaystyle sin\left(\dfrac{2 \pi x}{a}\right).\)