I need an extention that can do these two things, nothing more.
Code:
integer distance(int A, int B)
{
int AtoBforw = abs(A-B);
int AtoBback = abs(A-(B-360));
if(AtoBforw>AtoBback)
{
return AtoBback;
}else{
return AtoBforw;
}
}
integer way(int A, int B)
{
int AtoBforw = abs(A-B);
int AtoBback = abs(A-(B-360));
if(AtoBforw > AtoBback)
{
return 1;
}else if(AtoBforw < AtoBback){
return -1;
}else{
return 0;
}
}
Sorry if you don't understand it, it is meant to get the distance between two angles and the direction you need to go to get there.
Also sorry if some of my syntax is wrong, I've never programmed anything in C++ before.