Log In  

Atan2 in PICO-8 returns different values than other programming languages such as python.

For python the result is:

But in PICO-8 it is:

How would I implement the python Atan2 into PICO-8?

P#116283 2022-08-25 18:19 ( Edited 2022-08-25 18:23)

2

1) pico-8 does atan2(x,y) instead of (y,x) (*)
2) pico-8 angles go from 0 to 1
3) pico-8 angles are inverted (*)
they run clockwise from 3 o'clock
0.00 is full right
0.25 is full down
0.50 is full left
0.75 is full up
1.00 is full right too

so (1.0-atan2(x,y))*2*PI should be you radian angle

(*) which are two major PITAs IMHO - I actually got used to angles being (0,1) though

P#116292 2022-08-25 20:10 ( Edited 2022-08-25 20:13)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 17:46:08 | 0.006s | Q:10