mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +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):
|
||||
def interpolate_submobject(self, submob, start, alpha):
|
||||
Homotopy.interpolate_submobject(self, submob, start, alpha)
|
||||
submob.make_approximately_smooth()
|
||||
CONFIG = {
|
||||
"apply_function_kwargs": {"make_smooth": True},
|
||||
}
|
||||
|
||||
|
||||
class ComplexHomotopy(Homotopy):
|
||||
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):
|
||||
c = complex_homotopy(complex(x, y), t)
|
||||
return (c.real, c.imag, z)
|
||||
Homotopy.__init__(self, homotopy, mobject, **kwargs)
|
||||
super().__init__(homotopy, mobject, **kwargs)
|
||||
|
||||
|
||||
class PhaseFlow(Animation):
|
||||
|
|
Loading…
Add table
Reference in a new issue