Hi,
I am writing a small software for some CNC machine, which generates NC code for the desired shape. now i am facing problem in having drills at some specific position and direction, i.e. i know the unit vector of drill and its position but don't know how to convert it in NC code.

I have a 4-Axis machine from Roland, and want to calculate angle A, by which i should rotate the rotary axis, and some help in transformation of position after rotation.