diff --git a/src/path.c b/src/path.c index 22491a6..2ccf81a 100644 --- a/src/path.c +++ b/src/path.c @@ -26,7 +26,7 @@ path *path_new(map* m,vehicle *v){ /* Calculate a trivial path to the origin*/ /* Turn towards origin, take shorter direction*/ - angle = atan2(v->y,v->x)*180/M_PI; + angle = atan2(-v->y,-v->x)*180/M_PI; stop = abs(angle - v->dir)/m->max_turn*1000; printf("Angle: %f stop: %f\n",angle,stop); if(angle - v->dir > 0){