Slight changes to zeta implementation, along with SolveZeta Scene

This commit is contained in:
Grant Sanderson 2018-03-20 12:57:49 -07:00
parent bf9e28dbb5
commit 2d55673850

View file

@ -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