From 2d55673850ef72c5b735a8f7a3f4522f7e7c507f Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Tue, 20 Mar 2018 12:57:49 -0700 Subject: [PATCH] Slight changes to zeta implementation, along with SolveZeta Scene --- active_projects/WindingNumber.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/active_projects/WindingNumber.py b/active_projects/WindingNumber.py index a439f25c..7c9225db 100644 --- a/active_projects/WindingNumber.py +++ b/active_projects/WindingNumber.py @@ -540,12 +540,19 @@ def point3d_func_from_complex_func(f): return point3d_func_from_plane_func(plane_func_from_complex_func(f)) def plane_zeta((x, y)): - answer = mpmath.zeta(complex(x, y)) CLAMP_SIZE = 1000 + z = complex(x, y) + try: + answer = mpmath.zeta(z) + except ValueError: + return (CLAMP_SIZE, 0) if abs(answer) > CLAMP_SIZE: answer = answer/abs(answer) * CLAMP_SIZE return (float(answer.real), float(answer.imag)) +def rescaled_plane_zeta((x, y)): + return plane_zeta((x/SPACE_WIDTH, 8*y)) + # Returns a function from 2-ples to 2-ples # This function is specified by a list of (x, y, z) tuples, # and has winding number z (or total of all specified z) around each (x, y) @@ -2293,4 +2300,20 @@ class ZetaViz(PureColorMap): #"num_plane" : criticalStrip, "show_num_plane" : True } + +class RescaledZetaViz(PureColorMap): + CONFIG = { + "func" : rescaled_plane_zeta, + #"num_plane" : criticalStrip, + "show_num_plane" : True + } + +class SolveZeta(EquationSolver2d): + CONFIG = { + "func" : rescaled_plane_zeta, + "num_iterations" : 7, + "display_in_parallel" : False, + "use_fancy_lines" : True, + } + # FIN \ No newline at end of file