>>659

int Func( int a, int b )
{
int c = (a+360) - b;
c %= 360;

if( c > 180 )c -= 360;

return ( c );
}