from typing import Tuple
import math


def calculate_slope_bisectors(approach_slope: float, depart_slope: float, blend:float) -> Tuple[float, float]:
	"""
	"Average" two slopes by treating them as angles and finding the angle that bisects them.
	Is this better or worse than my original idea? No clue!
	By changing the value of AVERAGE_SLOPES_BY_HOW_MUCH you can control how much it moves towards
	this perfect bisector.
	
	:param approach_slope: float real-space slope when approaching a point
	:param depart_slope: float real-space slope when departing a point
	:param blend: float [0-1] how much to move toward perfect average
	:return: tuple(new_approach_slope, new_depart_slope)
	"""
	# this only needs to operate on one pair of slopes at a time
	# 3 convert this real-space slope to an angle, average them, and then convert back to slope again
	approach_angle = math.atan2(approach_slope, 1)
	depart_angle = math.atan2(depart_slope, 1)
	# one more knob to fiddle with: don't need to average these values all the way!
	center = (approach_angle + depart_angle) / 2
	new_approach_angle = (blend * center) + ((blend-1) * approach_angle)
	new_depart_angle = (blend * center) + ((blend-1) * depart_angle)
	
	# convert from angle back to real-space slope
	new_approach_slope = math.tan(new_approach_angle)
	new_depart_slope = math.tan(new_depart_angle)

	return new_approach_slope, new_depart_slope