#概要
manimの作法、調べてみた。
AnimatedStreamLines、使ってみた。
#サンプルコード
from manimlib.imports import *
def cylinder_flow_vector_field(point, R = 1, U = 1):
z = R3_to_complex(point)
return complex_to_R3(derivative(joukowsky_map)(z).conjugate())
def four_swirls_function(point):
x, y = point[:2]
result = (y ** 3 - 4 * y) * RIGHT + (x ** 3 - 16 * x) * UP
result *= 0.05
norm = get_norm(result)
if norm == 0:
return result
return result
class test(Scene):
CONFIG = {
"func": cylinder_flow_vector_field,
"flow_time": 15,
}
def construct(self):
lines = StreamLines(four_swirls_function, virtual_time = 3, min_magnitude = 0, max_magnitude = 2, )
self.add(AnimatedStreamLines(lines, line_anim_class = ShowPassingFlash))
self.wait(10)
#生成した動画
以上。