Polar Coordinates

Hello,
I'm working with an OLED 128x64 display, this is working with rectangular coordinates.
lets say that I want to input to the display polar coordinates- so of course Im not gonna change the library of the display, but maybe there is a way to do it with the math.h library, and convert rectangular to polar.
I already tried it- and its working! but... only with positive X and Y. and I want it to work also with negative numbers. And for me it looks like the atan is just not doing it... maybe Im doing something wrong? please help me and submit a code that WORKS.

Thank for any help, Arad. ;D

The problem is on line 42 where you have used atan() and not atan2() .

I didn’t know the answer and googled it successfully in the time it took for the first reply. What does that suggest to you?

BOOM! Stowite! thank you! ;D
Working like a charm! thank you so much for the quick reply. :slight_smile:

aarg! I know... but its not SO easy! Im not so expirienced... xD
I'm on google all day! So looks like its not only my code is problematic.. :stuck_out_tongue:

*hint: Im talking about my arduino skills... and ky skills in general...