0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

manimの作法 その54

Posted at

#概要

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)



#生成した動画

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?