chiark / gitweb /
break out moenp.py (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Nov 2017 14:34:11 +0000 (14:34 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Nov 2017 14:34:11 +0000 (14:34 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
helixish.py
moebius.py
moenp.py [new file with mode: 0644]

index 4543898a53c838ee4ea6b50129b24b0d6a93a4db..d7b1445502afdd64573d26ce29f774c08ffbb718 100644 (file)
@@ -6,6 +6,7 @@ from numpy import cos, sin
 
 import sys
 from moebdebug import dbg
+from moenp import *
 
 import symbolic
 
index bd98a825c6b1dac6f6eb1325ba5e06a005d8d580..4294d864140ca032b5fe44077be33d30c618da69 100644 (file)
@@ -5,19 +5,10 @@ import numpy as np
 from numpy import cos, sin
 
 from bezier import BezierSegment
+from moenp import *
 
 import sys
 
-tau = np.pi * 2
-
-origin = np.array((0,0,0))
-unit_x = np.array((1,0,0))
-unit_y = np.array((0,1,0))
-unit_z = np.array((0,0,1))
-
-def unit_v(v):
-  return v / np.linalg.norm(v)
-
 class DoubleCubicBezier():
   def __init__(db, cp):
     single = BezierSegment(cp)
diff --git a/moenp.py b/moenp.py
new file mode 100644 (file)
index 0000000..f4f277b
--- /dev/null
+++ b/moenp.py
@@ -0,0 +1,14 @@
+
+from __future__ import print_function
+
+import numpy as np
+
+tau = np.pi * 2
+
+origin = np.array((0,0,0))
+unit_x = np.array((1,0,0))
+unit_y = np.array((0,1,0))
+unit_z = np.array((0,0,1))
+
+def unit_v(v):
+  return v / np.linalg.norm(v)