Atan2

by Kaiochao
atan2(x, y) [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Kaiochao.Atan2##version=0

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Kaiochao.Atan2##version=0

36 downloads
Latest Version
Date added: Jul 9 2017
Last updated: Jul 24 2017
0 fans
atan2(x, y) returns the smallest angle in clockwise degrees between the vector (0, 1) and the vector (x, y).

Given a vector from one point to another point, this gives you an angle in degrees. This angle can be used for getting a rotation matrix to point something toward something else using atom.transform.

Comments

Delta0Zero2: (Jul 25 2017, 12:29 am)
 var/icon/I = new(usr.icon)
I.Turn(90)
sleep(22.5)
I.Turn(-90)
view() << "Kachoo"
D4RK3 54B3R: (Jul 24 2017, 10:07 pm)
Wait why is it relative to (0, 1) and not (1, 0)?