chiark / gitweb /
helixish: get sense of phi right
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Dec 2017 12:34:04 +0000 (12:34 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Dec 2017 12:34:05 +0000 (12:34 +0000)
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>
helixish.py

index 17922d6e3affe25955f0760830867b97f8cd37f9..ecbc79a08e179e6d7f54674e69d45922674d7698 100644 (file)
@@ -102,7 +102,7 @@ class HelixishCurve():
     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)