I'm trying to model something that seems fairly simple, but it's trickier than I thought on https://www.desmos.com.
On desmos I created a function:
$f(x)=y$
$y=(0 \leq x \leq 2)\sin( \pi x+b )$ to make a simple oscillating sine wave
I want to make a line of fixed length that has its origin on the sine wave, and moves along it when I play variable "b". (and maybe another variable that I don't realise that I need).
I've tried a couple of things like:
$y = (\sin(x) \leq x \leq ( \pi /4))y = mx + c$
$m = 2/ \pi$
and
points:
$(\cos(b), \sin(b))$
and
$(\pi/2, \sin(b))$
but I haven't quite got there yet
Once I have this sliding line, I want to do two things with it:
- make it's angle change, orthogonal to the line of the sine wave
- make a series of them moving along the sine wave.
I'm sure this is possible, and it's just that I'm not familiar enough in general to conjure it up.
any help would be warmly received.
thank you.
Disclaimer - I don't know enough to know whether this question has been answered already; and I don't know enough about how you want questions formatted on here or how to do it, sorry.
Ok... I'll try... If you know what a quiver plot is? Like this: https://www.stackoverflow.com/questions/45824733/plotting-wind-vectors-or-wind-barbs-in-a-1d-chart-using-matplotlib. If you can imagine the second image by user Guto was a series of lines moving along a sine of points (b, sin(2b) ) along sine wave sin(pi * x + b), it might be close. On that quiver plot the arrows change with angle that looks in some ways the same but also opposite to what I want, like some kind of rotational symmetry.
So maybe think of this as a kind of double pendulum simulation.
There are two pendulums in series of different lengths, a long one will have a longer period and smaller angle than the second shorter pendulum.
So as the big pendulum swings to the left, the little pendulum has to swing opposite to it to try and cancel out the swing.
It can do this if the angle of the big pendulum is smaller than the little pendulum, and and the period of the big pendulum is consequently longer.
So as the big pendulum swings to one side, the little pendulum has to swing to the other side
On desmos, I want to represent the big pendulum as a sine wave. The little pendulum then has to be a short line that has its origin on the sine wave and the little pendulum has to swing in a way that is equal and opposite to the angle of the sine, and that's represented by being perpendicular to it, at all points along the sine.