/tg/ Station 13 - Modules - Types

# code/__HELPERS/maths.dm

/proc/get_angle Calculate the angle between two movables and the west|east coordinate Calculate the angle produced by a pair of x and y deltas Angle between two arbitrary points and horizontal line same as /proc/get_angle for getting the angle when animating something's pixel_x and pixel_y Get a list of turfs in a line from `starting_atom` to `ending_atom`. Get a list of turfs in a perimeter given the `center_atom` and `radius`. Automatically rounds down decimals and does not accept values less than positive 1 as they dont play well with it. Is efficient on large circles but ugly on small ones Uses Jesko`s method to the midpoint circle Algorithm. Formats a number into a list representing the si unit. Access the coefficient with [SI_COEFFICIENT], and access the unit with [SI_UNIT]. Format a power value in prefixed watts. Format an energy value in prefixed joules. Format an energy value measured in Power Cell units. chances are 1:value. anyprob(1) will always return true counts the number of bits in Byond's 16-bit width field, in constant time and memory! Returns the name of the mathematical tuple of same length as the number arg (rounded down). Takes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold Takes two values x and y, and returns 1/((1/x) + y) Useful for providing an additive modifier to a value that is used as a divisor, such as `/obj/projectile/var/speed`