# Describing the path of a particle on a wheel that changes direction

So I start with a particle rolling along the outside of a wheel. This can be constructed by setting up a vector function for a circle and adding a constant velocity to one component.

My wheel is going to be moving horizontally with a velocity v_0, so my vector is... $$\vec{s}=(r \cos t+v_{0}t)\hat{x}+r\sin t\hat{y}$$

Now I want to implement a condition where the particle will 'bounce back' in the opposite direction once it has met a specific angle from the center. This step will change the path from looking like a flattened spring to a bent sine wave. Hopefully these pictures will help illustrate this.

The bottom function is a bit similar to the affect I am trying to achieve, but it is not circular. Anyway, is this just accomplished with a piece-wise function?

What you are looking for seems to be $$\vec s=(r \cos(f(t))+v_0 t)\hat x+(r\sin(f(t)))\hat y \tag1$$ where $f(t)$ is a triangle wave function. You can get formulas for such functions from various sources such as this, this, or others you can find by searching for "triangle wave function".
One way to write a triangle wave function is $$f(x) = {(-1)^{\lfloor t/P+1/2\rfloor}}2A \left(\frac tP - \left\lfloor \frac tP + \frac12\right\rfloor \right)$$ where $A$ is the amplitude and $P$ is the period of the function. The function will oscillate between the values $-A$ and $A.$ If $P=2A$ then $f(x)$ has slope $1$ or $-1$ when its slope is defined, which seems to be what you want. Substitute this for $f(t)$ in Equation $1$ and see what you get as a result.
It looks like your $y$ period became twice longer. Don't change the period of the $y$ component and everything will be OK. Instead you should take negative velocity $v_0$ leaving the rest the same.
It looks also that your point moves counterclockwise when wheel moves forward. So you need to change $\sin t$ to $\sin(-t)$. When you point begin to move back you should change $\sin(-t)$ to $\sin t$ again.
• Could you, please, check with this settings: for the both curves $t\in [0,6\pi]$,for the first curve $x = r\cos t + vt, y = \sin -t$, for the second curve $x = -vt + r\cos t + (-r\cos 0 + 6\pi v + r \cos 6\pi),y = r\sin t/2$. Is that what you want to see? – lR55 Jan 26 '17 at 6:15