Small changes to Homotopy animations

This commit is contained in:
Grant Sanderson 2021-02-05 19:58:29 -08:00
parent 514301e0af
commit a2f201f59e

View file

@ -28,20 +28,22 @@ class Homotopy(Animation):
class SmoothedVectorizedHomotopy(Homotopy): class SmoothedVectorizedHomotopy(Homotopy):
def interpolate_submobject(self, submob, start, alpha): CONFIG = {
Homotopy.interpolate_submobject(self, submob, start, alpha) "apply_function_kwargs": {"make_smooth": True},
submob.make_approximately_smooth() }
class ComplexHomotopy(Homotopy): class ComplexHomotopy(Homotopy):
def __init__(self, complex_homotopy, mobject, **kwargs): def __init__(self, complex_homotopy, mobject, **kwargs):
""" """
Complex Hootopy a function Cx[0, 1] to C Given a function form (z, t) -> w, where z and w
are complex numbers and t is time, this animates
the state over time
""" """
def homotopy(x, y, z, t): def homotopy(x, y, z, t):
c = complex_homotopy(complex(x, y), t) c = complex_homotopy(complex(x, y), t)
return (c.real, c.imag, z) return (c.real, c.imag, z)
Homotopy.__init__(self, homotopy, mobject, **kwargs) super().__init__(homotopy, mobject, **kwargs)
class PhaseFlow(Animation): class PhaseFlow(Animation):