Closed GregEakin closed 2 years ago
Take a closer look at a reference for how std::atan2() works -- it takes y as its first argument. Try calling the simulator's test function unitTestBasicTypes(). It has some tests to make sure that Coord::asDir() returns the correct direction, and I believe the proposed change triggers a failure. But thanks for checking the code; I'm sure there are plenty of bugs to be found.
I did not see that. Thanks. Turns out I had my unit test backwards.
The X and Y variables are swapped in the atan2() function. This takes us in the wrong direction.