diff --git a/code/__defines/math.dm b/code/__defines/math.dm index 2f8aae7b4e..f9c520276d 100644 --- a/code/__defines/math.dm +++ b/code/__defines/math.dm @@ -9,9 +9,6 @@ #define SHORT_REAL_LIMIT 16777216 -#define ATAN2(x, y) arctan(x, y) - - //"fancy" math for calculating time in ms from tick_usage percentage and the length of ticks //percent_of_tick_used * (ticklag * 100(to convert to ms)) / 100(percent ratio) //collapsed to percent_of_tick_used * tick_lag diff --git a/code/datums/position_point_vector.dm b/code/datums/position_point_vector.dm index eb5127aed6..0b39481f85 100644 --- a/code/datums/position_point_vector.dm +++ b/code/datums/position_point_vector.dm @@ -64,7 +64,7 @@ return sqrt(((b.x - a.x) ** 2) + ((b.y - a.y) ** 2)) /proc/angle_between_points(datum/point/a, datum/point/b) - return ATAN2((b.y - a.y), (b.x - a.x)) + return arctan((b.y - a.y), (b.x - a.x)) /datum/point //A precise point on the map in absolute pixel locations based on world.icon_size. Pixels are FROM THE EDGE OF THE MAP! var/x = 0 diff --git a/code/game/machinery/pointdefense.dm b/code/game/machinery/pointdefense.dm index 4efd32c273..c3f95202f4 100644 --- a/code/game/machinery/pointdefense.dm +++ b/code/game/machinery/pointdefense.dm @@ -213,7 +213,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense) addtimer(CALLBACK(src, .proc/finish_shot, target), rotation_speed) animate(src, transform = rot_matrix, rotation_speed, easing = SINE_EASING) - set_dir(ATAN2(transform.b, transform.a) > 0 ? NORTH : SOUTH) + set_dir(arctan(transform.b, transform.a) > 0 ? NORTH : SOUTH) /obj/machinery/pointdefense/proc/finish_shot(var/weakref/target) @@ -237,7 +237,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense) return if(!active) return - var/desiredir = ATAN2(transform.b, transform.a) > 0 ? NORTH : SOUTH + var/desiredir = arctan(transform.b, transform.a) > 0 ? NORTH : SOUTH if(dir != desiredir) set_dir(desiredir) diff --git a/code/modules/compass/compass_waypoint.dm b/code/modules/compass/compass_waypoint.dm index 24f9978bb8..b7ef7b6509 100644 --- a/code/modules/compass/compass_waypoint.dm +++ b/code/modules/compass/compass_waypoint.dm @@ -23,5 +23,5 @@ /datum/compass_waypoint/proc/recalculate_heading(var/cx, var/cy) var/matrix/M = matrix() M.Translate(0, (name ? COMPASS_LABEL_OFFSET-4 : COMPASS_LABEL_OFFSET)) - M.Turn(ATAN2(cy-y, cx-x)+180) + M.Turn(arctan(cy-y, cx-x)+180) compass_overlay.transform = M diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index a2f2c85fff..216e93718f 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -49,7 +49,7 @@ continue if(!O.scannable) continue - var/bearing = round(90 - ATAN2(O.x - linked.x, O.y - linked.y),5) + var/bearing = round(90 - arctan(O.x - linked.x, O.y - linked.y),5) if(bearing < 0) bearing += 360 contacts.Add(list(list("name"=O.name, "ref"="\ref[O]", "bearing"=bearing))) diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm index e49bfec13a..3816454144 100644 --- a/code/modules/overmap/ships/ship.dm +++ b/code/modules/overmap/ships/ship.dm @@ -106,7 +106,7 @@ // Get heading in degrees (like a compass heading) /obj/effect/overmap/visitable/ship/proc/get_heading_degrees() - return (ATAN2(speed[2], speed[1]) + 360) % 360 // Yes ATAN2(y, x) is correct to get clockwise degrees + return (arctan(speed[2], speed[1]) + 360) % 360 // Yes arctan(y, x) is correct to get clockwise degrees /obj/effect/overmap/visitable/ship/proc/adjust_speed(n_x, n_y) var/old_still = is_still() diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index c7c012c3d4..b06e33db76 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -427,7 +427,7 @@ var/ox = round(screenviewX/2) - user.client.pixel_x //"origin" x var/oy = round(screenviewY/2) - user.client.pixel_y //"origin" y - angle = ATAN2(y - oy, x - ox) + angle = arctan(y - oy, x - ox) return list(angle, p_x, p_y) /obj/item/projectile/proc/redirect(x, y, starting, source)