From: Ian Jackson Date: Sat, 30 Dec 2017 12:30:55 +0000 (+0000) Subject: helixish: angles are unconventionally represented in "Railway problem" X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=13d1fa51f59f3f40ebf64854e8c24605c29a97ef;p=moebius3.git helixish: angles are unconventionally represented in "Railway problem" Signed-off-by: Ian Jackson --- diff --git a/helixish.py b/helixish.py index 0235e5b..6703f47 100644 --- a/helixish.py +++ b/helixish.py @@ -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)