What solution did you go with? The solution that popped in my head was imagining a line from 0,0 to N,M on a pixelized grid. Two horizontal pixels next to each other represent a turn for the first unit and two vertical pixels represent a turn for the second unit. Could work with non integer speeds and could work with an arbitrary amount of units.