import math


def calc_turn_value(us, them, current_yaw):
    """ Calc turn speed required to steer 'us' towards 'them'."""
    dx = them[0] - us[0]
    dz = them[1] - us[1]
    yaw = -180 * math.atan2(dx, dz) / math.pi
    difference = yaw - current_yaw
    while difference < -180:
        difference += 360
    while difference > 180:
        difference -= 360
    difference /= 180.0
    return difference