mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 08:54:38 +08:00
After running 2to3
This commit is contained in:
@ -132,7 +132,7 @@ class ManyPrerequisites(Scene):
|
||||
|
||||
self.play(Write(rects[0]))
|
||||
self.wait()
|
||||
self.play(*map(FadeIn, rects[1:]))
|
||||
self.play(*list(map(FadeIn, rects[1:])))
|
||||
self.wait()
|
||||
|
||||
class ExampleTranformationScene(LinearTransformationScene):
|
||||
@ -308,7 +308,7 @@ class AllXAxisVectorsAreEigenvectors(ExampleTranformationScene):
|
||||
def construct(self):
|
||||
vectors = VGroup(*[
|
||||
self.add_vector(u*x*RIGHT, animate = False)
|
||||
for x in reversed(range(1, int(FRAME_X_RADIUS)+1))
|
||||
for x in reversed(list(range(1, int(FRAME_X_RADIUS)+1)))
|
||||
for u in -1, 1
|
||||
])
|
||||
vectors.set_color_by_gradient(YELLOW, X_COLOR)
|
||||
@ -465,8 +465,8 @@ class NameEigenvectorsAndEigenvalues(ExampleTranformationScene):
|
||||
path_arc = 0,
|
||||
)
|
||||
self.wait(2)
|
||||
self.play(*map(FadeOut, [non_eigen, non_eigen_span]))
|
||||
self.play(*map(MoveToTarget, [x_words, sneak_words]))
|
||||
self.play(*list(map(FadeOut, [non_eigen, non_eigen_span])))
|
||||
self.play(*list(map(MoveToTarget, [x_words, sneak_words])))
|
||||
self.wait()
|
||||
for words in x_words, sneak_words:
|
||||
self.play(Write(words.eigen_val_words), run_time = 2)
|
||||
@ -591,23 +591,23 @@ class ContrastMatrixUnderstandingWithEigenvalue(TeacherStudentsScene):
|
||||
everyone = self.get_pi_creatures()
|
||||
self.play(
|
||||
Write(axis_and_rotation),
|
||||
*it.chain(*zip(
|
||||
*it.chain(*list(zip(
|
||||
[pi.change_mode for pi in everyone],
|
||||
["hooray"]*4,
|
||||
[pi.look_at for pi in everyone],
|
||||
[axis_and_rotation]*4,
|
||||
)),
|
||||
))),
|
||||
run_time = 2
|
||||
)
|
||||
self.random_blink(2)
|
||||
self.play(
|
||||
Transform(axis_and_rotation, matrix),
|
||||
*it.chain(*zip(
|
||||
*it.chain(*list(zip(
|
||||
[pi.change_mode for pi in everyone],
|
||||
["confused"]*4,
|
||||
[pi.look_at for pi in everyone],
|
||||
[matrix]*4,
|
||||
))
|
||||
)))
|
||||
|
||||
)
|
||||
self.random_blink(3)
|
||||
@ -704,11 +704,11 @@ class SymbolicEigenvectors(Scene):
|
||||
Write(lamb_text)
|
||||
)
|
||||
self.wait(2)
|
||||
self.play(*map(FadeOut, [
|
||||
self.play(*list(map(FadeOut, [
|
||||
A_brace, A_text,
|
||||
lamb_brace, lamb_text,
|
||||
v_text, v_arrows
|
||||
]))
|
||||
])))
|
||||
|
||||
def contrast_multiplication_types(self):
|
||||
A, v1, equals, lamb, v2 = self.expression
|
||||
@ -756,11 +756,11 @@ class SymbolicEigenvectors(Scene):
|
||||
)
|
||||
self.play(Blink(morty))
|
||||
self.wait()
|
||||
self.play(*map(FadeOut, [
|
||||
self.play(*list(map(FadeOut, [
|
||||
left_group.brace, left_group.text,
|
||||
right_group.brace, right_group.text,
|
||||
morty, bubble, solve_text
|
||||
]))
|
||||
])))
|
||||
|
||||
def rewrite_righthand_side(self):
|
||||
A, v1, equals, lamb, v2 = self.expression
|
||||
@ -848,12 +848,12 @@ class SymbolicEigenvectors(Scene):
|
||||
).arrange_submobjects().next_to(equals).shift(SMALL_BUFF*UP)
|
||||
self.play(
|
||||
Write(parens),
|
||||
*map(MoveToTarget, [lamb, id_text, v2])
|
||||
*list(map(MoveToTarget, [lamb, id_text, v2]))
|
||||
)
|
||||
self.wait()
|
||||
self.play(*map(FadeOut, [
|
||||
self.play(*list(map(FadeOut, [
|
||||
corner_group, id_brace, id_text_copy, new_lamb
|
||||
]))
|
||||
])))
|
||||
self.expression = VGroup(
|
||||
A, v1, equals,
|
||||
VGroup(l_paren, lamb, id_text, r_paren),
|
||||
@ -878,7 +878,7 @@ class SymbolicEigenvectors(Scene):
|
||||
self.play(
|
||||
Write(zero),
|
||||
Write(minus),
|
||||
*map(MoveToTarget, movers),
|
||||
*list(map(MoveToTarget, movers)),
|
||||
path_arc = np.pi/3
|
||||
)
|
||||
self.wait()
|
||||
@ -1299,12 +1299,12 @@ class RevisitExampleTransformation(ExampleTranformationScene):
|
||||
rect.target = BackgroundRectangle(
|
||||
VGroup(l_bracket.target, r_bracket.target)
|
||||
)
|
||||
result = map(MoveToTarget, movers)
|
||||
result += map(Write, [minus1, minus2])
|
||||
result += map(Animation, [
|
||||
result = list(map(MoveToTarget, movers))
|
||||
result += list(map(Write, [minus1, minus2]))
|
||||
result += list(map(Animation, [
|
||||
self.matrix.get_mob_matrix()[i, 1-i]
|
||||
for i in range(2)
|
||||
])
|
||||
]))
|
||||
self.diag_entries = [
|
||||
VGroup(three, minus1, lamb),
|
||||
VGroup(two, minus2, lamb_copy),
|
||||
@ -1385,8 +1385,8 @@ class RevisitExampleTransformation(ExampleTranformationScene):
|
||||
)
|
||||
self.wait()
|
||||
self.play(*it.chain(
|
||||
map(MoveToTarget, [brace, brace_text]),
|
||||
map(FadeOut, [one, zero, minus, cdot, new_rect])
|
||||
list(map(MoveToTarget, [brace, brace_text])),
|
||||
list(map(FadeOut, [one, zero, minus, cdot, new_rect]))
|
||||
))
|
||||
self.wait()
|
||||
self.play(Write(equals_0))
|
||||
@ -1404,7 +1404,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):
|
||||
if to_fade is not None:
|
||||
faders.append(to_fade)
|
||||
self.play(*it.chain(
|
||||
map(FadeOut, faders),
|
||||
list(map(FadeOut, faders)),
|
||||
[
|
||||
lambda_equals_two.scale_in_place, 1.3,
|
||||
lambda_equals_two.next_to, self.matrix, DOWN
|
||||
@ -1423,7 +1423,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):
|
||||
self.play(Transform(lamb, two))
|
||||
self.play(*it.chain(
|
||||
[mob.restore for mob in (self.plane, self.i_hat, self.j_hat)],
|
||||
map(Animation, self.foreground_mobjects),
|
||||
list(map(Animation, self.foreground_mobjects)),
|
||||
))
|
||||
|
||||
xy_array = Matrix(["x", "y"])
|
||||
@ -1436,7 +1436,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):
|
||||
equals = TexMobject("=").next_to(xy_array)
|
||||
equals.add_background_rectangle()
|
||||
zero_array.next_to(equals)
|
||||
self.play(*map(Write, [xy_array, equals, zero_array]))
|
||||
self.play(*list(map(Write, [xy_array, equals, zero_array])))
|
||||
self.wait()
|
||||
|
||||
vectors = VGroup(*[
|
||||
@ -1452,7 +1452,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):
|
||||
submobject_mode = "lagged_start",
|
||||
run_time = 2
|
||||
),
|
||||
*map(Animation, self.foreground_mobjects)
|
||||
*list(map(Animation, self.foreground_mobjects))
|
||||
)
|
||||
self.wait()
|
||||
self.apply_transposed_matrix(
|
||||
@ -1461,8 +1461,8 @@ class RevisitExampleTransformation(ExampleTranformationScene):
|
||||
self.wait()
|
||||
self.play(*it.chain(
|
||||
[mob.restore for mob in (self.plane, self.i_hat, self.j_hat, vectors)],
|
||||
map(FadeOut, [xy_array, equals, zero_array]),
|
||||
map(Animation, self.foreground_mobjects)
|
||||
list(map(FadeOut, [xy_array, equals, zero_array])),
|
||||
list(map(Animation, self.foreground_mobjects))
|
||||
))
|
||||
|
||||
def show_unaltered_transform(self):
|
||||
@ -1480,8 +1480,8 @@ class RevisitExampleTransformation(ExampleTranformationScene):
|
||||
self.lambda_equals_two.target = brace_text
|
||||
movers.append(self.lambda_equals_two)
|
||||
self.play(*it.chain(
|
||||
map(MoveToTarget, movers),
|
||||
map(FadeOut, faders),
|
||||
list(map(MoveToTarget, movers)),
|
||||
list(map(FadeOut, faders)),
|
||||
[GrowFromCenter(brace)]
|
||||
))
|
||||
VGroup(*faders).set_fill(opacity = 0)
|
||||
@ -1550,7 +1550,7 @@ class SolveRotationEigenvalues(Rotate90Degrees):
|
||||
|
||||
det_text = get_det_text(self.matrix)
|
||||
equals = TexMobject("=").next_to(det_text)
|
||||
self.play(*map(Write, [det_text, equals]))
|
||||
self.play(*list(map(Write, [det_text, equals])))
|
||||
self.wait()
|
||||
minus = TexMobject("-")
|
||||
for entries, sym in (diag_entries, equals), (off_diag_entries, minus):
|
||||
@ -1721,9 +1721,9 @@ class ShearExample(RevisitExampleTransformation):
|
||||
Write(brace_text)
|
||||
)
|
||||
self.wait()
|
||||
self.play(* map(FadeOut, [
|
||||
self.play(* list(map(FadeOut, [
|
||||
one, zero, minus, cdot, new_rect, brace, brace_text
|
||||
]))
|
||||
])))
|
||||
self.wait()
|
||||
self.play(Write(equals_0))
|
||||
self.wait()
|
||||
@ -1782,11 +1782,11 @@ class ScalingExample(LinearTransformationScene):
|
||||
|
||||
class IntroduceEigenbasis(TeacherStudentsScene):
|
||||
def construct(self):
|
||||
words1, words2 = map(TextMobject, [
|
||||
words1, words2 = list(map(TextMobject, [
|
||||
"Finish with ``eigenbasis.''",
|
||||
"""Make sure you've
|
||||
watched the last video"""
|
||||
])
|
||||
]))
|
||||
words1.set_color(YELLOW)
|
||||
self.teacher_says(words1)
|
||||
self.change_student_modes(
|
||||
@ -1845,7 +1845,7 @@ class BasisVectorsAreEigenvectors(LinearTransformationScene):
|
||||
for array in matrix, i_coords, j_coords:
|
||||
array.rect = BackgroundRectangle(array)
|
||||
array.add_to_back(array.rect)
|
||||
self.play(*map(Write, [i_coords, j_coords]))
|
||||
self.play(*list(map(Write, [i_coords, j_coords])))
|
||||
self.wait()
|
||||
self.play(
|
||||
Transform(i_coords.rect, matrix.rect),
|
||||
@ -1945,11 +1945,11 @@ class RepeatedMultiplicationInAction(Scene):
|
||||
]), LEFT)
|
||||
|
||||
self.add(vector)
|
||||
self.play(*map(FadeIn, [matrix]+scalars))
|
||||
self.play(*list(map(FadeIn, [matrix]+scalars)))
|
||||
self.wait()
|
||||
self.play(
|
||||
FadeOut(matrix),
|
||||
*map(MoveToTarget, scalars + [l_bracket])
|
||||
*list(map(MoveToTarget, scalars + [l_bracket]))
|
||||
)
|
||||
self.wait()
|
||||
#nth multiplications
|
||||
@ -1977,11 +1977,11 @@ class RepeatedMultiplicationInAction(Scene):
|
||||
]), LEFT)
|
||||
movers.append(l_bracket)
|
||||
|
||||
self.play(*map(FadeIn, [matrix]+new_scalars))
|
||||
self.play(*list(map(FadeIn, [matrix]+new_scalars)))
|
||||
self.wait()
|
||||
self.play(
|
||||
FadeOut(matrix),
|
||||
*map(MoveToTarget, movers)
|
||||
*list(map(MoveToTarget, movers))
|
||||
)
|
||||
self.remove(*to_remove)
|
||||
self.wait()
|
||||
@ -2048,8 +2048,8 @@ class RepeatedMultilpicationOfMatrices(Scene):
|
||||
).next_to(vector, LEFT)
|
||||
|
||||
self.play(*it.chain(
|
||||
map(FadeOut, [brace, brace_text[1]] + list(matrices[:-1])),
|
||||
map(MoveToTarget, [hundred, hundred_copy, last_matrix])
|
||||
list(map(FadeOut, [brace, brace_text[1]] + list(matrices[:-1]))),
|
||||
list(map(MoveToTarget, [hundred, hundred_copy, last_matrix]))
|
||||
), run_time = 2)
|
||||
self.wait()
|
||||
else:
|
||||
@ -2216,7 +2216,7 @@ class ChangeToEigenBasis(ExampleTranformationScene):
|
||||
)
|
||||
self.wait()
|
||||
self.add_foreground_mobject(cob_matrix, inv_cob, neg_1)
|
||||
self.play(*map(FadeOut, self.to_fade))
|
||||
self.play(*list(map(FadeOut, self.to_fade)))
|
||||
self.wait()
|
||||
self.play(FadeOut(self.plane))
|
||||
cob_transform = self.get_matrix_transformation([[1, 0], [-1, 1]])
|
||||
@ -2225,7 +2225,7 @@ class ChangeToEigenBasis(ExampleTranformationScene):
|
||||
self.plane.axes.set_color(WHITE)
|
||||
self.play(
|
||||
FadeIn(self.plane),
|
||||
*map(Animation, self.foreground_mobjects+self.moving_vectors)
|
||||
*list(map(Animation, self.foreground_mobjects+self.moving_vectors))
|
||||
)
|
||||
self.add(self.plane.copy().set_color(GREY).set_stroke(width = 2))
|
||||
self.apply_transposed_matrix(self.t_matrix)
|
||||
|
Reference in New Issue
Block a user