hypot(x, y) [More]
To download this library for your Linux/Mac installation, enter this on your command line:
DreamDownload byond://Kaiochao.Hypot##version=0Emulator users, in the BYOND pager go to File | Open Location and enter this URL:
This library consists of a single proc: hypot(x, y).
It's often used to calculate the distance between points in 2D. That is, the straight Euclidean distance, rather than the "Chessboard" distance of get_dist() and bounds_dist(). Said another way, this computes the magnitude of your everyday 2D vector (x, y).
See here for more information:
This is where the implementation comes from. Apparently, it's not as simple as
sqrt(x * x + y * y).
Copyright © 2019 BYOND Software. All rights reserved.