Error in the code

Jump to navigation Jump to search

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)17:17, 15 September 2013