Kirk, Do you have a #0 tool position? With an incremental counter going from passing the #0 tool, just check the increment, and if it's equal to or larger than the median go one way, and if it's smaller than the median go the other.
Mark At 12:58 PM 3/10/2010, you 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. > >-- >Kirk Wallace >http://www.wallacecompany.com/machine_shop/ >http://www.wallacecompany.com/E45/index.html >California, USA > > >------------------------------------------------------------------------------ >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 ------------------------------------------------------------------------------ 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