Error in the code

Jump to navigation Jump to search
Revision as of 15 September 2013 at 15:17.
This is the thread's initial revision.

Error in the code

I think there is a mistake in your code. It seems you have switched from degrees to radians, but not switched all of the actual math.

setTurnRightRadians(e.getBearing()+90-40*movementDirection);

This should actually be

setTurnRightRadians(e.getBearingRadians() + Math.PI/2 - (Math.PI/4.5)*movementDirection);

or

setTurnRightRadians(Math.toRadians(e.getBearing() + 90 - 40*movementDirection);
    Maribo (talk)16:17, 15 September 2013