Produce program of slave from path of master and desired relative position