mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Small changes to Homotopy animations
This commit is contained in:
parent
514301e0af
commit
a2f201f59e
1 changed files with 7 additions and 5 deletions
|
@ -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):
|
||||||
|
|
Loading…
Add table
Reference in a new issue