Convert cartesian to machine coordinates