Kirk Wallace wrote: > I need a C algorithm that solves the shortest distance to a carousel > tool (encoder wraps at 0). I can solve the distance from the current to > the target tool with three tests, CW distance CCW distance, then test > for the shortest, but it seems I should be able to do this in one test. > I suspect the solution is so simple, I'll slap my forehead when I see > it. Thanks. > You could use the modmath component.
Or look at the source code for the algorithm I chose :) - Steve ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users