import sys
from moebdebug import dbg
+import symbolic
+
def augment(v): return np.append(v, 1)
def augment0(v): return np.append(v, 0)
def unaugment(v): return v[0:3]
class HelixishCurve():
def __init__(hc, cp):
+ symbolic.calculate()
+
p = cp[0]
q = cp[3]
dp = unit_v(cp[1]-cp[0])
if l is None: break
findcurve_result = l[0:5]
-
+ symbolic.get_python(something)
from moedebug import dbg_enable
+from sympy.utilities.lambdify import lambdify, implemented_function
+
r, theta, s, la, mu, kappa = symbols('r theta s lambda mu kappa')
# start original formulation
print('\n =\n')
pprint(cse(eval(vn)))
+calculated = False
+
def calculate():
+ global calculated
+ if calculated: return
+
p_start = Matrix([
r * (1 - cos(theta)),
r * sin(theta),
global sh, th
sh, th = symbols('alpha beta')
+ global q_sqparm
q_dirn_sqparm = q_dirn_orgcoords.replace(s, sh**2).replace(t, th**2)
q_sqparm = q_orgcoords .replace(s, sh**2).replace(t, th**2)
result_dirnscaled = q_sqparm.col_join(q_dirn_dirnscaled)
dbg('result_dirnscaled')
+ calculated = True
+
params = ('sh','th','la','mu','gamma','kappa')
def ourccode(*a, **kw):
gen_x_extract()
gen_f_populate()
gen_j_populate()
+
+def get_python():
+ # https://github.com/sympy/sympy/issues/13642
+ # "lambdify sinc gives wrong answer!"
+ sinc_fixed = Function('sinc_fixed')
+ implemented_function(sinc_fixed, lambda x: np.sinc(x/np.pi))
+ p = list(map(eval,params))
+ p.append(s)
+ return lambdify(p, q_sqparm)