In "Railway problem", phi is the direction we _leave_ Q. Whereas in
our original representation, we have a direction vector in the
positive sense of the parameter (ie, for Q, the arrival direction).
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
railway_angleoffset = atan2(*q_plane[0:2])
# these two angles are unconventional: clockwise from north
railway_theta = tau/4 - (atan2(*dp_plane[0:2]) - railway_angleoffset)
- railway_phi = tau/4 - (atan2(*dq_plane[0:2]) - railway_angleoffset)
+ railway_phi = tau/4 - (atan2(*-dq_plane[0:2]) - railway_angleoffset)
railway_cos_theta = cos(railway_theta)
railway_cos_phi = cos(railway_phi)