mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Slight changes to zeta implementation, along with SolveZeta Scene
This commit is contained in:
parent
bf9e28dbb5
commit
2d55673850
1 changed files with 24 additions and 1 deletions
|
@ -540,12 +540,19 @@ def point3d_func_from_complex_func(f):
|
||||||
return point3d_func_from_plane_func(plane_func_from_complex_func(f))
|
return point3d_func_from_plane_func(plane_func_from_complex_func(f))
|
||||||
|
|
||||||
def plane_zeta((x, y)):
|
def plane_zeta((x, y)):
|
||||||
answer = mpmath.zeta(complex(x, y))
|
|
||||||
CLAMP_SIZE = 1000
|
CLAMP_SIZE = 1000
|
||||||
|
z = complex(x, y)
|
||||||
|
try:
|
||||||
|
answer = mpmath.zeta(z)
|
||||||
|
except ValueError:
|
||||||
|
return (CLAMP_SIZE, 0)
|
||||||
if abs(answer) > CLAMP_SIZE:
|
if abs(answer) > CLAMP_SIZE:
|
||||||
answer = answer/abs(answer) * CLAMP_SIZE
|
answer = answer/abs(answer) * CLAMP_SIZE
|
||||||
return (float(answer.real), float(answer.imag))
|
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
|
# Returns a function from 2-ples to 2-ples
|
||||||
# This function is specified by a list of (x, y, z) tuples,
|
# 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)
|
# 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,
|
#"num_plane" : criticalStrip,
|
||||||
"show_num_plane" : True
|
"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
|
# FIN
|
Loading…
Add table
Reference in a new issue