Find the quickest distance from one angle to the next BTW, I don't really know how to use LaTeX, so please correct this for me... thanks.
So I've been wrestling this for about an hour, but it kept failing all the time.  Basically, I'm trying to find the shortest direction to change from one angle to the next.  Here are some examples:


*

*From 90 degrees to 225, it would be faster to increase angle, since it would only have to go 135 degrees instead of 225 degrees rotating the other way.

*From 90 degrees to 315, it would be faster to decrease angle.  Reason is opposite of previous.


Sorry that I don't have an image, but if this is unclear please ask.
Is there a formula that I can use that doesn't relate conditional statements?  Thanks for your help guys :D
 A: Take the new angle minus the old angle.  If the absolute value of the difference is less than $180$ you have the correct sign.  If not, you have the wrong sign.  This works as long as both angles are in the range $0$ to just under $360$ degrees.
A: N.B.: The following method is more appropriate for when you don’t have the two angles handy, for instance, when you’re working with a velocity vector and a specific location that you want to turn toward. If you have the angles already, subtracting and adjusting the result if it’s out of range as described by Ross Millikan is simple and efficient. 
You’re trying to determine the direction in which the change in angle has an absolute value of less than 180 degrees. One way to do this is by looking at the sign of the ”cross product” (in quotes because we’re working in two dimensions) of vectors that point in the two directions. Assuming that increase counterclockwise, a positive indicates that the new heading is closer with a left (counterclockwise) turn; a negative value means a right turn.  
Specifically, let $\alpha$ be the current heading and $\beta$ the desired new heading. We’ll use unit vectors $u=(\cos\alpha,\sin\alpha)$ and $v=(\cos\beta,\sin\beta)$, but any pair of vectors that point in the right directions will do. Compute $$\begin{vmatrix}u_x&u_y\\v_x&v_y\end{vmatrix}=u_xv_y-u_yv_x$$ and interpret the sign of this value as described above. This determinant is positive if going from the origin to $u$ and then to $v$ takes you counterclockwise around the perimeter of a triangle. What you’re doing here is computing $\sin(\beta-\alpha)$ times the lengths of the two vectors. These lengths are always positive so don’t affect the sign of the result, which is why we don’t insist on using unit vectors.  
I’ll assume the standard Cartesian coordinate system with 0° pointing in the direction of the positive $x$-axis and angles increasing counterclockwise. The direction that corresponds to 0° doesn’t matter, but changing the direction in which positive angles are measured will reverse all of the signs. For the three directions in your example we have the unit vectors $a=(0,1)$, $b=(-1/\sqrt2,-1/\sqrt2)$ and $c=(1/\sqrt2,-1/\sqrt2)$. For the first case we compute $0\cdot(-1/\sqrt2)-1\cdot(-1/\sqrt2)=1/\sqrt2\gt0$, so a left turn is faster. For the second example, we end up with $-1/\sqrt2\lt0$, so a right turn is faster.
