math - How to reflect an angle across the Y axis -


I am not a mathematician, but I have somehow got into the development of the game as a hobby.

Anything beyond basic mathematics, I have a lot of trouble, in which it can be ascertained how in contrast to some angle, in the opposite direction, X axis and amp;

An image more than 1000 words (especially uneducated words) says:

I basically want to reverse the direction of the artillery objects that follow a robot. When the robot changes from facing the right to face the left side, then I do (180 - angle) as everyone suggests to me, but it really reverses the angle, by which They target the cannons while defining the targets. So, I need to do something else, but it escapes my knowledge.

To keep it in other words, I work in 2D, so I want an angle facing the right to face right. <0> "Completely true"

  • 180 "left"
  • 90 "up" and
  • My angles are defined:

    • 270 "Down"

    I want something that is aiming with an angle of 9 when the reverse turns to 89. No Z axis exists Anybody would be very kind to help me in this way?

    How many guns are defined in your game, more about it, but I give some hints Will try

    It looks like your cannon is seen from the edge, and you want it to leave from right but facing the cannon. This calculation depends on the direction that direction is 0, and whether the angles run according to clockwise or anticoquize.

    If there is a cannon pointing upward directly at an angle of 0, then the angle is measured straight up, clockwise. Therefore, the reverse angle-group will be if the negative angle is not used (360-angle).

    If there is an angle pointing at the right of 0 and an angle of 45 points from the bottom right then the angle facing the cannon is going straight 270 along with 180 to 360. Therefore, to reverse an angle, you will use (540-angle).

    If there is a right pointing angle in the angle of 0, but the 45 digit angle points to the right above, the cannon angles are from 0 to 180. To change the angle, use (180-angle).

    I hope that helps! Lee


    Comments

    Popular posts from this blog

    windows - Heroku throws SQLITE3 Read only exception -

    lex - Building a lexical Analyzer in Java -

    python - rename keys in a dictionary -