# Rotation and direction

Im trying to make a triangle move around the screen, which I can do fine, but I would like the top point of my isosceles triangle to rotate when the user presses the right or left keys (which I know I can use the rotate property) and then make the point of the triangle (which has now been rotated slightly) be the direction that the triangle moves when pressing the up key.

I think Im talking about a relative coordinate system which is relative to the triangle that I need to use, but Im not sure, can anyone help me out with this?

Well i have been doing a lot of research and it really turns out that the question Im asking about has nothing to do with JavaFX specifically. More of the maths and theory behind the physics of movement.

I have got the triangle somewhat moving and its just a matter of tweaking it from now on I think.

Thanks for the help though, Im making a sort of asteroids game, so be sure that I'll be posting some more questions as I go along!

The standard way is using linear transformations like rotation matrix:

http://mathworld.wolfram.com/RotationMatrix.html

Could you post a code snippet with the rotated triangle and point out the thing that does not work?