Which angle is correct?

Using my best high school trigonometry I was able to figure out the correct angle for any particular station, but other orientations of the previous and next stations required different calculations. It seemed like I would need very complex control flow to use this method to find the angle bisector.