polyglot:
the best way is to learn about Bresenham's Algorithm and work from there. It's a neat way of drawing a straight line when you have discrete output steps, eg pixels or CNC steps.
Just out of curiosity on my part, is it different from the mechanism I suggested in Reply #7?
...R