mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-22 20:56:33 +01:00
remove ATAN2 define
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)))
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user