chiark / gitweb /
helixish: use @ for matrix multiplication
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Nov 2017 22:09:00 +0000 (22:09 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Nov 2017 22:09:03 +0000 (22:09 +0000)
Older numpy wants you to use the matrix type.  Newer Python and numpy
can use @.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
helixish.py

index c5c30d785408b1bf2ab771d48d7a3a6b0035316e..1536ce6455e01f3bc62d63afb51a40bfe14c5f32 100644 (file)
@@ -52,9 +52,10 @@ class HelixishCurve():
     dPQplane_basis = np.vstack((dPQplane_basis, [0,0,0,1]))
     dPQplane_into = np.linalg.inv(dPQplane_basis)
 
-    dp_plane = unaugment(dPQplane_into * augment0(dp))
-    dq_plane = unaugment(dPQplane_into * augment0(dq))
-    q_plane  = unaugment(dPQplane_into * augment(q))
+    dp_plane = unaugment(dPQplane_into @ augment0(dp))
+    dq_plane = unaugment(dPQplane_into @ augment0(dq))
+    q_plane  = dPQplane_into @ augment(q)
+    q_plane  = unaugment(dPQplane_into @ augment(q))
     dist_pq_plane = np.linalg.norm(q_plane)
 
     # two circular arcs of equal maximum possible radius