Hey, I'm trying to use trig to create a rotating tank (you rotate the tank by pressing left and right, and move forward and back by using up and down). I'm using this formula (C++):
tank.movex = cos(tank.direction*0.0174532925)*tank.move; tank.movey = sin(tank.direction*0.0174532925)*tank.move; tank.x += tank.movex; tank.y += tank.movey;
tank.move is 5 if the up arrow is pressed and it's -5 if the down arrow is pressed. tank.direction tank.direction increases by 3 when your press the left arrow, and it decreases by 3 when you press the right arrow (i have a function make sure that it's within the range 0-359 inclusive)
should this work? because when the angle gets to 45 degrees it starts acting like it's at 135.