remove ATAN2 define

This commit is contained in:
spookerton
2022-03-31 19:23:29 +01:00
parent b4c3fe9eeb
commit 2dda71ecf0
7 changed files with 7 additions and 10 deletions
-3
View File
@@ -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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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
@@ -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)))
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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)