If the picture shows what you actually want to do, you need a "step" function, that is, a function defined differently over different sections. The first move, directly to the left would be of the form x= constant, y= f(t), then x= g(t), y= constant, etc. if the tool is moving at constant speed, that would be x= constant, y= -vt (v is the speed), x= -vt, y= constant, etc.