from numpy import cos, sin
import sys
-from moebdebug import dbg
+from moedebug import dbg
from moenp import *
import symbolic
# but minimum is 10% of (wlog) {s,t} [[ not quite like this ]]
dPQplane_normal = np.cross(dp, dq)
- if (np.norm(dPQplane_normal) < 1E6):
+ if (np.linalg.norm(dPQplane_normal) < 1E6):
dPQplane_normal += [0, 0, 1E5]
dPQplane_normal = unit_v(dPQplane_normal)
findcurve_input = np.hstack((findcurve_target,
findcurve_start,
- [findcurve_epsilon])))
+ [findcurve_epsilon]))
dbg('RUNNING FINDCURVE', *findcurve_input)
print(findcurve_subproc.stdin, *findcurve_input)
findcurve_subproc.stdin.flush()
dbg('GOT ', l)
l = eval(l)
if l is None: break
- findcurve_result = l[0:5]
- symbolic.get_python(something)
+ hc.findcurve_result = l[0:5]
+ hc.func = symbolic.get_python(something)
+ hc.threshold = l[0]**2
+ hc.total_dist = hc.threshold + l[1]**2
+
+ def point_at_t(hc, normalised_parameter):
+ dist = normalised_parameter * hc.total_dist
+ ours = [p for p in findcurve_result]
+ if dist <= hc.threshold:
+ ours[0] = sqrt(dist)
+ ours[1] = 0
+ else:
+ ours[1] = sqrt(dist - hc.threshold)
+ return hc.func(*ours)
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)