Oramac Posted March 22, 2016 Report Share Posted March 22, 2016 2 hours ago, buckswrath said: The graphics library i'm using uses a unit circle that is different than the unit circle that all trigonometric functions use, in order to orient objects on the screen. A normal unit circle is setup with 0° in the positive X direction, 90° in the positive Y direction, 180° in the negative X direction, and 270° in the negative Y direction. Their circle is rotated 90° counter-clockwise, and flipped over the Y axis. This combined with the fact that most computers consider the positive Y to go down the screen makes 0° point in the negative Y direction, 90° in the positive X direction, 180° in the positive Y direction, and 270° in the negative X direction. The fix turned out to be taking the angle from the graphics library multiplying it by -1 and adding 360° to get the angle on the standard unit circle. Since the program window has a flipped y-axis, I had to take the converted angle and plug it into the negative sine function and negative cosine function to get the X and Y, respectively. Then, I could take the X and Y and use it to modify the direction of my object. I haven't got a clue why the maintainers of the graphics library couldn't set up a unit circle correctly. Oh well. 1 Quote "Someone ever tries to kill you, you try to kill 'em right back." - Captain Malcolm Reynolds Current Challenge Also, I Agree With Tank™ Link to comment
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.