Tag Info

New answers tagged


Since you only care about eliminating branches and "complex" operations beyond arithmetic, I would recommend this: min(abs(angle1 - angle2), abs(angle2 - angle1)) You still need an abs in there despite all angles being positive. Otherwise, the most negative result will always be chosen (and there will always be exactly one negative answer for positive, ...


Based on the question, assuming that turning to the right is going a negative angle, and going to the left is going a positive angle. Here is a small graphical reminder: To determine what is the difference in the input, you need to constrain the delta to the same range you use: This is the excel formula I used (row 8, with the "old" value in column A ...

Top 50 recent answers are included