The problem of determining the inputs to the rotary axes of a 5-axis CNC machine is addressed, such that relative variations of orientation between the tool axis and surface normal are minimized subject to the constraint of maintaining a constant cutting speed with a ball-end tool. In the context of an orientable-spindle machine, the results of a prior study are directly applicable to the solution of this inverse-kinematics problem. However, since they are expressed in terms of the integral of the geodesic curvature, a discrete time-step solution is proposed that yields accurate rotary-axis increments at high sampling frequencies. For an orientable-table machine, a closed-form solution that specifies the rotary-axis positions as functions of the surface normal variation along the toolpath is possible. In this context, however, the feasibility of a solution is dependent upon the surface normal along the toolpath satisfying certain orientational constraints. These inverse-kinematics solutions facilitate accurate and efficient 5-axis machining of free-form surfaces without "unnecessary" actuation of the machine rotary axes. © 2013 Elsevier B.V.