I am trying to build an object title. I have four point vectors - let's call them
mdexmdey(aka x1,y1),thpxthpy(aka x2,y2).
I find the change in y, and change in x( dyand dx), and then inserting it into a function atan2d. Then I look at the results and draw them on the chart.
The scale on the chart goes from -180 to 180. My problem occurs when the line goes through -180 or 180 degrees. Then it βpops upβ to the opposite side of the chart (i.e. What would be 181 is actually -179).
This is problematic because it looks like there are big shifts in the corner, when in fact it is not - it is just a βflippingβ. Also, it twists my angular speed calculations, which are based on how much has changed between points. Initially, I just tried to convert the chart to a 0-360 scale, adding 180 to all the values ββthat were below 0. That didn't work.
Here is a graph so you can better understand the problem (a graph after I tried the 0-360 conversion).

My question
I am wondering if there is another function that I can use to calculate an angle that would give me a value that is constantly increasing, a way to modify the data so that it draws nicely, or a way to change the graph so that it looks intuitive?
Thanks in advance!