Artificial intelligent assistant

Function for this game movement graph? This may be too easy for you, but here goes: I'm creating a kind of ski slalom game where I want the horizontal speed/direction to follow the attached graph. X is time, Y is horizontal speed. Positive horizontal speed makes my skier go right, negative horizontal speed makes the skier go left. I want to be able to adjust the max speed (A), the time to maintain max speed (B), and the time it takes for the skier to make a turn (C). What is the function for this? Thanks! !enter image description here

It's not clear exactly what shapes you want for your family of functions, but here is one family of functions that will capture the qualitative type of variability you want, and matches your given shape nicely e.g. for $\alpha = 3$:

$$f(x) = A \cdot \hbox{sign}(\cos Dx) \cdot |\cos (Dx)|^{\alpha}$$

where $A$ controls the height, $D$ controls the overall width of each cycle ($B + C$ in your diagram), and $\alpha > 0$ controls how big $B$ is compared to $C$. Try values of $\alpha$ like $0.25,0.5,1,2,3$ and make plots and you'll see what you can get. Hopefully the types of shapes are to your liking; these plots definitely have the property though that you get tradeoff between $B$ and $C$ as you vary $\alpha$, and controlling $A$ is trivial as it just requires a constant multiplier.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5fecc0696c04716c0e46cb1b303e013e