Original Post
Hey guys. I'm trying to figure out a math problem for my 2D game, but for some reason I'm drawing a blank (not to mention I didn't make a very good grade in geometry class...) I have these: ship_maxVelocity (the fastest this ship will travel) ship_angle (rotational value in radians) ship_velocity[0] (velocity along the 'x' axis, between 'ship_maxVelocity * -1' and 'ship_maxVelocity') ship_velocity[1] (velocity along the 'y' axis, between 'ship_maxVelocity * -1' and 'ship_maxVelocity') And I want to use those to create a single, floating-point forward velocity value that's between ship_maxVelocity * -1 and ship_maxVelocity In other words, if I'm flying backwards in any direction and 'ship_maxVelocity' = 250, then my forward velocity value should be (-250). But if I'm flying forwards in any direction and 'ship_maxVelocity' = 250, then my forward velocity value should be 250. On the same note, if I'm flying sideways then my forward velocity value should be around zero. How should I create my equasion? I'm stumped! Thanks in advance for the help!