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?



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




[Please log in to post a comment]