Thanks irving, I worked out what I needed this morning on the drive in to work and I agree with you. I just got the sin and cos swapped over but that don't matter it just rotates it through 90 degrees.
It's good to have confirmation before I try and code it. I am using the free language called Processing, it runs on all platforms.

Do you think there would be any interest if I posted the final result? I am also working on a program to send a G code file to the miller. I wanted to use Replicator G but I can't get that to work reliably on my Mac, despite several email exchanges with the authors.