Factored out topics/complex_numbers constructs to the appropriate places with mobject/, animation/ and scene/

This commit is contained in:
Grant Sanderson
2018-03-31 18:57:21 -07:00
parent 267bfd52dd
commit 73514a2d77
5 changed files with 34 additions and 42 deletions

View File

@ -34,6 +34,18 @@ class SmoothedVectorizedHomotopy(Homotopy):
Homotopy.update_submobject(self, submob, start, alpha)
submob.make_smooth()
class ComplexHomotopy(Homotopy):
def __init__(self, complex_homotopy, mobject, **kwargs):
"""
Complex Hootopy a function Cx[0, 1] to C
"""
def homotopy(event):
x, y, z, t = event
c = complex_homotopy((complex(x, y), t))
return (c.real, c.imag, z)
Homotopy.__init__(self, homotopy, mobject, *args, **kwargs)
class PhaseFlow(Animation):
CONFIG = {
"virtual_time" : 1,