chiark / gitweb /
helixish: angles are unconventionally represented in "Railway problem"
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Dec 2017 12:30:55 +0000 (12:30 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Dec 2017 12:30:55 +0000 (12:30 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
helixish.py

index 0235e5b5aaa7558be48062182663dbd5f2231a05..6703f4707f2a42f2cdb4d8ef4b7eb0855618302d 100644 (file)
@@ -100,8 +100,9 @@ class HelixishCurve():
     # algorithm courtesy of Simon Tatham (`Railway problem',
     # pers.comm. to ijackson@chiark 23.1.2004)
     railway_angleoffset = atan2(*q_plane[0:2])
-    railway_theta = atan2(*dp_plane[0:2]) - railway_angleoffset
-    railway_phi   = atan2(*dq_plane[0:2]) - railway_angleoffset
+    # 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_cos_theta = cos(railway_theta)
     railway_cos_phi   = cos(railway_phi)