mirror of
https://github.com/3b1b/videos.git
synced 2025-08-31 21:58:59 +00:00
Globally replace .points references with .get_points or .set_points depending on context
This commit is contained in:
parent
831594be01
commit
df6f3d2937
77 changed files with 359 additions and 380 deletions
|
@ -331,7 +331,7 @@ class WalkingRandolph(GraphScene):
|
||||||
|
|
||||||
def construct(self):
|
def construct(self):
|
||||||
GraphScene.construct(self)
|
GraphScene.construct(self)
|
||||||
point_path = [self.points[i] for i in self.path]
|
point_path = [self.get_points()[i] for i in self.path]
|
||||||
randy = Randolph()
|
randy = Randolph()
|
||||||
randy.scale(RANDOLPH_SCALE_FACTOR)
|
randy.scale(RANDOLPH_SCALE_FACTOR)
|
||||||
randy.move_to(point_path[0])
|
randy.move_to(point_path[0])
|
||||||
|
@ -364,15 +364,15 @@ class PathExamples(GraphScene):
|
||||||
for path, non_path in zip(paths, non_paths):
|
for path, non_path in zip(paths, non_paths):
|
||||||
path_lines = Mobject(*[
|
path_lines = Mobject(*[
|
||||||
Line(
|
Line(
|
||||||
self.points[path[i]],
|
self.get_points()[path[i]],
|
||||||
self.points[path[i+1]]
|
self.get_points()[path[i+1]]
|
||||||
).set_color("yellow")
|
).set_color("yellow")
|
||||||
for i in range(len(path) - 1)
|
for i in range(len(path) - 1)
|
||||||
])
|
])
|
||||||
non_path_lines = Mobject(*[
|
non_path_lines = Mobject(*[
|
||||||
Line(
|
Line(
|
||||||
self.points[pp[0]],
|
self.get_points()[pp[0]],
|
||||||
self.points[pp[1]],
|
self.get_points()[pp[1]],
|
||||||
).set_color("yellow")
|
).set_color("yellow")
|
||||||
for pp in non_path
|
for pp in non_path
|
||||||
])
|
])
|
||||||
|
@ -414,7 +414,7 @@ class IntroduceRandolph(GraphScene):
|
||||||
name = TextMobject("Randolph")
|
name = TextMobject("Randolph")
|
||||||
self.play(Transform(
|
self.play(Transform(
|
||||||
randy,
|
randy,
|
||||||
deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR).move_to(self.points[0]),
|
deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR).move_to(self.get_points()[0]),
|
||||||
))
|
))
|
||||||
self.wait()
|
self.wait()
|
||||||
name.shift((0, 1, 0))
|
name.shift((0, 1, 0))
|
||||||
|
@ -425,7 +425,7 @@ class DefineSpanningTree(GraphScene):
|
||||||
def construct(self):
|
def construct(self):
|
||||||
GraphScene.construct(self)
|
GraphScene.construct(self)
|
||||||
randy = Randolph()
|
randy = Randolph()
|
||||||
randy.scale(RANDOLPH_SCALE_FACTOR).move_to(self.points[0])
|
randy.scale(RANDOLPH_SCALE_FACTOR).move_to(self.get_points()[0])
|
||||||
dollar_signs = TextMobject("\\$\\$")
|
dollar_signs = TextMobject("\\$\\$")
|
||||||
dollar_signs.scale(EDGE_ANNOTATION_SCALE_FACTOR)
|
dollar_signs.scale(EDGE_ANNOTATION_SCALE_FACTOR)
|
||||||
dollar_signs = Mobject(*[
|
dollar_signs = Mobject(*[
|
||||||
|
@ -437,7 +437,7 @@ class DefineSpanningTree(GraphScene):
|
||||||
self.generate_spanning_tree()
|
self.generate_spanning_tree()
|
||||||
def green_dot_at_index(index):
|
def green_dot_at_index(index):
|
||||||
return Dot(
|
return Dot(
|
||||||
self.points[index],
|
self.get_points()[index],
|
||||||
radius = 2*Dot.DEFAULT_RADIUS,
|
radius = 2*Dot.DEFAULT_RADIUS,
|
||||||
color = "lightgreen",
|
color = "lightgreen",
|
||||||
)
|
)
|
||||||
|
@ -459,8 +459,8 @@ class DefineSpanningTree(GraphScene):
|
||||||
for pair in self.spanning_tree_index_pairs:
|
for pair in self.spanning_tree_index_pairs:
|
||||||
self.play(ShowCreation(
|
self.play(ShowCreation(
|
||||||
Line(
|
Line(
|
||||||
self.points[pair[0]],
|
self.get_points()[pair[0]],
|
||||||
self.points[pair[1]]
|
self.get_points()[pair[1]]
|
||||||
).set_color("yellow"),
|
).set_color("yellow"),
|
||||||
run_time = run_time_per_branch
|
run_time = run_time_per_branch
|
||||||
))
|
))
|
||||||
|
@ -472,7 +472,7 @@ class DefineSpanningTree(GraphScene):
|
||||||
|
|
||||||
unneeded_edges = list(filter(out_of_spanning_set, self.graph.edges))
|
unneeded_edges = list(filter(out_of_spanning_set, self.graph.edges))
|
||||||
for edge, limit in zip(unneeded_edges, list(range(5))):
|
for edge, limit in zip(unneeded_edges, list(range(5))):
|
||||||
line = Line(self.points[edge[0]], self.points[edge[1]])
|
line = Line(self.get_points()[edge[0]], self.get_points()[edge[1]])
|
||||||
line.set_color("red")
|
line.set_color("red")
|
||||||
self.play(ShowCreation(line, run_time = 1.0))
|
self.play(ShowCreation(line, run_time = 1.0))
|
||||||
self.add(unneeded.center().shift(line.get_center() + 0.2*UP))
|
self.add(unneeded.center().shift(line.get_center() + 0.2*UP))
|
||||||
|
@ -622,9 +622,9 @@ class ExamplesOfGraphs(GraphScene):
|
||||||
)).to_corner().shift(0.5*RIGHT).split()
|
)).to_corner().shift(0.5*RIGHT).split()
|
||||||
horizontal_line = Line(
|
horizontal_line = Line(
|
||||||
(-FRAME_X_RADIUS, FRAME_Y_RADIUS-1, 0),
|
(-FRAME_X_RADIUS, FRAME_Y_RADIUS-1, 0),
|
||||||
(max(notions.points[:,0]), FRAME_Y_RADIUS-1, 0)
|
(max(notions.get_points()[:,0]), FRAME_Y_RADIUS-1, 0)
|
||||||
)
|
)
|
||||||
vert_line_x_val = min(notions.points[:,0]) - buff
|
vert_line_x_val = min(notions.get_points()[:,0]) - buff
|
||||||
vertical_line = Line(
|
vertical_line = Line(
|
||||||
(vert_line_x_val, FRAME_Y_RADIUS, 0),
|
(vert_line_x_val, FRAME_Y_RADIUS, 0),
|
||||||
(vert_line_x_val,-FRAME_Y_RADIUS, 0)
|
(vert_line_x_val,-FRAME_Y_RADIUS, 0)
|
||||||
|
@ -701,7 +701,7 @@ class ExamplesOfGraphs(GraphScene):
|
||||||
not_connected = TextMobject("Not Connected")
|
not_connected = TextMobject("Not Connected")
|
||||||
not_connected.set_color("red")
|
not_connected.set_color("red")
|
||||||
for mob in connected, not_connected:
|
for mob in connected, not_connected:
|
||||||
mob.shift(self.points[3] + UP)
|
mob.shift(self.get_points()[3] + UP)
|
||||||
|
|
||||||
self.play(*[
|
self.play(*[
|
||||||
ShowCreation(mob, run_time = 1.0)
|
ShowCreation(mob, run_time = 1.0)
|
||||||
|
@ -836,7 +836,7 @@ class ListOfCorrespondances(Scene):
|
||||||
this_arrow = deepcopy(arrow)
|
this_arrow = deepcopy(arrow)
|
||||||
for mob in left, right, this_arrow:
|
for mob in left, right, this_arrow:
|
||||||
mob.shift(height*UP)
|
mob.shift(height*UP)
|
||||||
arrow_xs = this_arrow.points[:,0]
|
arrow_xs = this_arrow.get_points()[:,0]
|
||||||
left.to_edge(RIGHT)
|
left.to_edge(RIGHT)
|
||||||
left.shift((min(arrow_xs) - FRAME_X_RADIUS, 0, 0))
|
left.shift((min(arrow_xs) - FRAME_X_RADIUS, 0, 0))
|
||||||
right.to_edge(LEFT)
|
right.to_edge(LEFT)
|
||||||
|
@ -863,15 +863,15 @@ class CyclesCorrespondWithConnectedComponents(GraphScene):
|
||||||
enclosed_vertices = [0, 1]
|
enclosed_vertices = [0, 1]
|
||||||
randy = Randolph()
|
randy = Randolph()
|
||||||
randy.scale(RANDOLPH_SCALE_FACTOR)
|
randy.scale(RANDOLPH_SCALE_FACTOR)
|
||||||
randy.move_to(self.points[cycle[0]])
|
randy.move_to(self.get_points()[cycle[0]])
|
||||||
|
|
||||||
lines_to_remove = []
|
lines_to_remove = []
|
||||||
for last, next in zip(cycle, cycle[1:]):
|
for last, next in zip(cycle, cycle[1:]):
|
||||||
line = Line(self.points[last], self.points[next])
|
line = Line(self.get_points()[last], self.get_points()[next])
|
||||||
line.set_color("yellow")
|
line.set_color("yellow")
|
||||||
self.play(
|
self.play(
|
||||||
ShowCreation(line),
|
ShowCreation(line),
|
||||||
WalkPiCreature(randy, self.points[next]),
|
WalkPiCreature(randy, self.get_points()[next]),
|
||||||
run_time = 1.0
|
run_time = 1.0
|
||||||
)
|
)
|
||||||
lines_to_remove.append(line)
|
lines_to_remove.append(line)
|
||||||
|
@ -911,7 +911,7 @@ class IntroduceMortimer(GraphScene):
|
||||||
randy_path = (0, 1, 3)
|
randy_path = (0, 1, 3)
|
||||||
morty_path = (-2, -3, -4)
|
morty_path = (-2, -3, -4)
|
||||||
morty_crossed_lines = [
|
morty_crossed_lines = [
|
||||||
Line(self.points[i], self.points[j]).set_color("red")
|
Line(self.get_points()[i], self.get_points()[j]).set_color("red")
|
||||||
for i, j in [(7, 1), (1, 5)]
|
for i, j in [(7, 1), (1, 5)]
|
||||||
]
|
]
|
||||||
kwargs = {"run_time" : 1.0}
|
kwargs = {"run_time" : 1.0}
|
||||||
|
@ -924,7 +924,7 @@ class IntroduceMortimer(GraphScene):
|
||||||
self.remove(name)
|
self.remove(name)
|
||||||
small_randy = deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR)
|
small_randy = deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR)
|
||||||
small_morty = deepcopy(morty).scale(RANDOLPH_SCALE_FACTOR)
|
small_morty = deepcopy(morty).scale(RANDOLPH_SCALE_FACTOR)
|
||||||
small_randy.move_to(self.points[randy_path[0]])
|
small_randy.move_to(self.get_points()[randy_path[0]])
|
||||||
small_morty.move_to(self.dual_points[morty_path[0]])
|
small_morty.move_to(self.dual_points[morty_path[0]])
|
||||||
self.play(*[
|
self.play(*[
|
||||||
FadeIn(mob)
|
FadeIn(mob)
|
||||||
|
@ -942,10 +942,10 @@ class IntroduceMortimer(GraphScene):
|
||||||
self.set_color_region(self.regions[next])
|
self.set_color_region(self.regions[next])
|
||||||
self.wait()
|
self.wait()
|
||||||
for last, next in zip(randy_path, randy_path[1:]):
|
for last, next in zip(randy_path, randy_path[1:]):
|
||||||
line = Line(self.points[last], self.points[next])
|
line = Line(self.get_points()[last], self.get_points()[next])
|
||||||
line.set_color("yellow")
|
line.set_color("yellow")
|
||||||
self.play(
|
self.play(
|
||||||
WalkPiCreature(randy, self.points[next]),
|
WalkPiCreature(randy, self.get_points()[next]),
|
||||||
ShowCreation(line),
|
ShowCreation(line),
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
@ -969,7 +969,7 @@ class RandolphMortimerSpanningTreeGame(GraphScene):
|
||||||
self.generate_regions()
|
self.generate_regions()
|
||||||
randy = Randolph().scale(RANDOLPH_SCALE_FACTOR)
|
randy = Randolph().scale(RANDOLPH_SCALE_FACTOR)
|
||||||
morty = Mortimer().scale(RANDOLPH_SCALE_FACTOR)
|
morty = Mortimer().scale(RANDOLPH_SCALE_FACTOR)
|
||||||
randy.move_to(self.points[0])
|
randy.move_to(self.get_points()[0])
|
||||||
morty.move_to(self.dual_points[0])
|
morty.move_to(self.dual_points[0])
|
||||||
attempted_dual_point_index = 2
|
attempted_dual_point_index = 2
|
||||||
region_ordering = [0, 1, 7, 2, 3, 5, 4, 6]
|
region_ordering = [0, 1, 7, 2, 3, 5, 4, 6]
|
||||||
|
@ -1005,7 +1005,7 @@ class RandolphMortimerSpanningTreeGame(GraphScene):
|
||||||
cycle = self.graph.region_cycles[cycle_index]
|
cycle = self.graph.region_cycles[cycle_index]
|
||||||
self.set_color_region(self.regions[cycle_index], "black")
|
self.set_color_region(self.regions[cycle_index], "black")
|
||||||
self.play(ShowCreation(Mobject(*[
|
self.play(ShowCreation(Mobject(*[
|
||||||
Line(self.points[last], self.points[next]).set_color("green")
|
Line(self.get_points()[last], self.get_points()[next]).set_color("green")
|
||||||
for last, next in zip(cycle, list(cycle)[1:] + [cycle[0]])
|
for last, next in zip(cycle, list(cycle)[1:] + [cycle[0]])
|
||||||
])))
|
])))
|
||||||
self.wait()
|
self.wait()
|
||||||
|
@ -1092,7 +1092,7 @@ class DualSpanningTree(GraphScene):
|
||||||
self.generate_spanning_tree()
|
self.generate_spanning_tree()
|
||||||
randy = Randolph()
|
randy = Randolph()
|
||||||
randy.scale(RANDOLPH_SCALE_FACTOR)
|
randy.scale(RANDOLPH_SCALE_FACTOR)
|
||||||
randy.move_to(self.points[0])
|
randy.move_to(self.get_points()[0])
|
||||||
morty = Mortimer()
|
morty = Mortimer()
|
||||||
morty.scale(RANDOLPH_SCALE_FACTOR)
|
morty.scale(RANDOLPH_SCALE_FACTOR)
|
||||||
morty.move_to(self.dual_points[0])
|
morty.move_to(self.dual_points[0])
|
||||||
|
@ -1119,14 +1119,14 @@ class TreeCountFormula(Scene):
|
||||||
gs.generate_treeified_spanning_tree()
|
gs.generate_treeified_spanning_tree()
|
||||||
branches = gs.treeified_spanning_tree.to_edge(LEFT).split()
|
branches = gs.treeified_spanning_tree.to_edge(LEFT).split()
|
||||||
|
|
||||||
all_dots = [Dot(branches[0].points[0])]
|
all_dots = [Dot(branches[0].get_points()[0])]
|
||||||
self.add(text, all_dots[0])
|
self.add(text, all_dots[0])
|
||||||
for branch in branches:
|
for branch in branches:
|
||||||
self.play(
|
self.play(
|
||||||
ShowCreation(branch),
|
ShowCreation(branch),
|
||||||
run_time = time_per_branch
|
run_time = time_per_branch
|
||||||
)
|
)
|
||||||
dot = Dot(branch.points[-1])
|
dot = Dot(branch.get_points()[-1])
|
||||||
self.add(dot)
|
self.add(dot)
|
||||||
all_dots.append(dot)
|
all_dots.append(dot)
|
||||||
self.wait()
|
self.wait()
|
||||||
|
|
|
@ -80,7 +80,7 @@ def convergent_sum():
|
||||||
def Underbrace(left, right):
|
def Underbrace(left, right):
|
||||||
result = TexMobject("\\Underbrace{%s}"%(14*"\\quad"))
|
result = TexMobject("\\Underbrace{%s}"%(14*"\\quad"))
|
||||||
result.stretch_to_fit_width(right[0]-left[0])
|
result.stretch_to_fit_width(right[0]-left[0])
|
||||||
result.shift(left - result.points[0])
|
result.shift(left - result.get_points()[0])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def zero_to_one_interval():
|
def zero_to_one_interval():
|
||||||
|
@ -154,14 +154,14 @@ class IntroduceDivergentSum(Scene):
|
||||||
equation[0].get_boundary_point(DOWN+LEFT),
|
equation[0].get_boundary_point(DOWN+LEFT),
|
||||||
equation[1].get_boundary_point(DOWN+RIGHT)
|
equation[1].get_boundary_point(DOWN+RIGHT)
|
||||||
).shift(0.2*DOWN)
|
).shift(0.2*DOWN)
|
||||||
min_x_coord = min(equation[0].points[:,0])
|
min_x_coord = min(equation[0].get_points()[:,0])
|
||||||
for x in range(NUM_WRITTEN_TERMS):
|
for x in range(NUM_WRITTEN_TERMS):
|
||||||
self.add(equation[x])
|
self.add(equation[x])
|
||||||
if x == 0:
|
if x == 0:
|
||||||
self.wait(0.75)
|
self.wait(0.75)
|
||||||
continue
|
continue
|
||||||
brace.stretch_to_fit_width(
|
brace.stretch_to_fit_width(
|
||||||
max(equation[x].points[:,0]) - min_x_coord
|
max(equation[x].get_points()[:,0]) - min_x_coord
|
||||||
)
|
)
|
||||||
brace.to_edge(LEFT, buff = FRAME_X_RADIUS+min_x_coord)
|
brace.to_edge(LEFT, buff = FRAME_X_RADIUS+min_x_coord)
|
||||||
if sum_value:
|
if sum_value:
|
||||||
|
@ -175,7 +175,7 @@ class IntroduceDivergentSum(Scene):
|
||||||
*[equation[NUM_WRITTEN_TERMS + i] for i in range(3)]
|
*[equation[NUM_WRITTEN_TERMS + i] for i in range(3)]
|
||||||
)
|
)
|
||||||
end_brace = deepcopy(brace).stretch_to_fit_width(
|
end_brace = deepcopy(brace).stretch_to_fit_width(
|
||||||
max(ellipses.points[:,0])-min_x_coord
|
max(ellipses.get_points()[:,0])-min_x_coord
|
||||||
).to_edge(LEFT, buff = FRAME_X_RADIUS+min_x_coord)
|
).to_edge(LEFT, buff = FRAME_X_RADIUS+min_x_coord)
|
||||||
kwargs = {"run_time" : 5.0, "rate_func" : rush_into}
|
kwargs = {"run_time" : 5.0, "rate_func" : rush_into}
|
||||||
flip_through = FlipThroughNumbers(
|
flip_through = FlipThroughNumbers(
|
||||||
|
@ -209,7 +209,7 @@ class ClearlyNonsense(Scene):
|
||||||
)
|
)
|
||||||
right_arrow = Arrow(
|
right_arrow = Arrow(
|
||||||
(FRAME_X_RADIUS-0.5)*RIGHT + DOWN,
|
(FRAME_X_RADIUS-0.5)*RIGHT + DOWN,
|
||||||
tail = (max(this_way.points[:,0]), -1, 0)
|
tail = (max(this_way.get_points()[:,0]), -1, 0)
|
||||||
)
|
)
|
||||||
how_here.set_color("red")
|
how_here.set_color("red")
|
||||||
neg_1_arrow.set_color("red")
|
neg_1_arrow.set_color("red")
|
||||||
|
@ -418,7 +418,7 @@ class DotsGettingCloser(Scene):
|
||||||
self.add(*dots)
|
self.add(*dots)
|
||||||
self.wait()
|
self.wait()
|
||||||
for x in range(10):
|
for x in range(10):
|
||||||
distance = min(dots[1].points[:,0])-max(dots[0].points[:,0])
|
distance = min(dots[1].get_points()[:,0])-max(dots[0].get_points()[:,0])
|
||||||
self.play(ApplyMethod(dots[0].shift, 0.5*distance*RIGHT))
|
self.play(ApplyMethod(dots[0].shift, 0.5*distance*RIGHT))
|
||||||
|
|
||||||
|
|
||||||
|
@ -757,7 +757,7 @@ class CircleZoomInOnOne(Scene):
|
||||||
])
|
])
|
||||||
self.wait()
|
self.wait()
|
||||||
for num in numbers[1:] + [text]:
|
for num in numbers[1:] + [text]:
|
||||||
curr_num.points = np.array(list(reversed(curr_num.points)))
|
curr_num.set_points(list(reversed(curr_num.get_points())))
|
||||||
self.play(
|
self.play(
|
||||||
ShowCreation(
|
ShowCreation(
|
||||||
curr_num,
|
curr_num,
|
||||||
|
@ -847,8 +847,8 @@ class DefineInfiniteSum(Scene):
|
||||||
lambda mob : mob.scale(0.5).to_corner(UP+LEFT, buff = buff),
|
lambda mob : mob.scale(0.5).to_corner(UP+LEFT, buff = buff),
|
||||||
expression
|
expression
|
||||||
))
|
))
|
||||||
bottom = (min(expression.points[:,1]) - buff)*UP
|
bottom = (min(expression.get_points()[:,1]) - buff)*UP
|
||||||
side = (max(expression.points[:,0]) + buff)*RIGHT
|
side = (max(expression.get_points()[:,0]) + buff)*RIGHT
|
||||||
lines = [
|
lines = [
|
||||||
Line(FRAME_X_RADIUS*LEFT+bottom, side+bottom),
|
Line(FRAME_X_RADIUS*LEFT+bottom, side+bottom),
|
||||||
Line(FRAME_Y_RADIUS*UP+side, side+bottom)
|
Line(FRAME_Y_RADIUS*UP+side, side+bottom)
|
||||||
|
@ -873,7 +873,7 @@ class DefineInfiniteSum(Scene):
|
||||||
number_line = NumberLine()
|
number_line = NumberLine()
|
||||||
ex_point = 2*RIGHT
|
ex_point = 2*RIGHT
|
||||||
ex = TexMobject("X").shift(ex_point + LEFT + UP)
|
ex = TexMobject("X").shift(ex_point + LEFT + UP)
|
||||||
arrow = Arrow(ex_point, tail = ex.points[-1]).nudge()
|
arrow = Arrow(ex_point, tail = ex.get_points()[-1]).nudge()
|
||||||
|
|
||||||
for term, count in zip(terms, it.count()):
|
for term, count in zip(terms, it.count()):
|
||||||
self.add(term)
|
self.add(term)
|
||||||
|
@ -954,7 +954,7 @@ class SeekMoreGeneralTruths(Scene):
|
||||||
for summand in summands
|
for summand in summands
|
||||||
], size = "")
|
], size = "")
|
||||||
sums.stretch_to_fit_height(FRAME_HEIGHT-1)
|
sums.stretch_to_fit_height(FRAME_HEIGHT-1)
|
||||||
sums.shift((FRAME_Y_RADIUS-0.5-max(sums.points[:,1]))*UP)
|
sums.shift((FRAME_Y_RADIUS-0.5-max(sums.get_points()[:,1]))*UP)
|
||||||
|
|
||||||
for qsum in sums.split():
|
for qsum in sums.split():
|
||||||
qsum.sort_points(lambda p : np.dot(p, DOWN+RIGHT))
|
qsum.sort_points(lambda p : np.dot(p, DOWN+RIGHT))
|
||||||
|
@ -1017,7 +1017,7 @@ class ChopIntervalInProportions(Scene):
|
||||||
brace.get_center()+0.3*UP,
|
brace.get_center()+0.3*UP,
|
||||||
tail = term.get_center()+0.5*DOWN
|
tail = term.get_center()+0.5*DOWN
|
||||||
)
|
)
|
||||||
arrow.points = np.array(list(reversed(arrow.points)))
|
arrow.set_points(list(reversed(arrow.get_points()))
|
||||||
additional_anims = [ShowCreation(arrow)]
|
additional_anims = [ShowCreation(arrow)]
|
||||||
if brace_to_replace is not None:
|
if brace_to_replace is not None:
|
||||||
if mode == "p":
|
if mode == "p":
|
||||||
|
@ -2025,7 +2025,7 @@ class PAdicMetric(Scene):
|
||||||
),
|
),
|
||||||
DelayByOrder(Transform(
|
DelayByOrder(Transform(
|
||||||
start,
|
start,
|
||||||
Point(arrow.points[0]).set_color("white")
|
Point(arrow.get_points()[0]).set_color("white")
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
self.play(ShimmerIn(end))
|
self.play(ShimmerIn(end))
|
||||||
|
|
|
@ -232,7 +232,7 @@ class ShowMatrixTransform(TransformScene2D):
|
||||||
if show_matrix:
|
if show_matrix:
|
||||||
self.add(matrix_mobject(matrix).to_corner(UP+LEFT))
|
self.add(matrix_mobject(matrix).to_corner(UP+LEFT))
|
||||||
def func(mobject):
|
def func(mobject):
|
||||||
mobject.points[:, :2] = np.dot(mobject.points[:, :2], np.transpose(matrix))
|
mobject.get_points()[:, :2] = np.dot(mobject.get_points()[:, :2], np.transpose(matrix))
|
||||||
return mobject
|
return mobject
|
||||||
|
|
||||||
self.wait()
|
self.wait()
|
||||||
|
@ -251,7 +251,7 @@ class ShowMatrixTransform(TransformScene2D):
|
||||||
)
|
)
|
||||||
arrow.remove_tip()
|
arrow.remove_tip()
|
||||||
new_arrow.remove_tip()
|
new_arrow.remove_tip()
|
||||||
Mobject.align_data(arrow, new_arrow)
|
Mobject.align_data_and_family(arrow, new_arrow)
|
||||||
arrow.add_tip()
|
arrow.add_tip()
|
||||||
new_arrow.add_tip()
|
new_arrow.add_tip()
|
||||||
anims.append(Transform(arrow, new_arrow, **kwargs))
|
anims.append(Transform(arrow, new_arrow, **kwargs))
|
||||||
|
@ -471,7 +471,7 @@ class ShowMatrixTransformWithDot(TransformScene2D):
|
||||||
if show_matrix:
|
if show_matrix:
|
||||||
self.add(matrix_mobject(matrix).to_corner(UP+LEFT))
|
self.add(matrix_mobject(matrix).to_corner(UP+LEFT))
|
||||||
def func(mobject):
|
def func(mobject):
|
||||||
mobject.points[:, :2] = np.dot(mobject.points[:, :2], np.transpose(matrix))
|
mobject.get_points()[:, :2] = np.dot(mobject.get_points()[:, :2], np.transpose(matrix))
|
||||||
return mobject
|
return mobject
|
||||||
dot = Dot((-1, 2, 0), color = "yellow")
|
dot = Dot((-1, 2, 0), color = "yellow")
|
||||||
self.add(dot)
|
self.add(dot)
|
||||||
|
@ -500,7 +500,7 @@ class ShowMatrixTransformWithDot(TransformScene2D):
|
||||||
)
|
)
|
||||||
arrow.remove_tip()
|
arrow.remove_tip()
|
||||||
new_arrow.remove_tip()
|
new_arrow.remove_tip()
|
||||||
Mobject.align_data(arrow, new_arrow)
|
Mobject.align_data_and_family(arrow, new_arrow)
|
||||||
arrow.add_tip()
|
arrow.add_tip()
|
||||||
new_arrow.add_tip()
|
new_arrow.add_tip()
|
||||||
anims.append(Transform(arrow, new_arrow, **kwargs))
|
anims.append(Transform(arrow, new_arrow, **kwargs))
|
||||||
|
|
|
@ -87,7 +87,7 @@ class CircleScene(Scene):
|
||||||
self.circle_pieces = []
|
self.circle_pieces = []
|
||||||
self.smaller_circle_pieces = []
|
self.smaller_circle_pieces = []
|
||||||
for i in range(len(self.points)):
|
for i in range(len(self.points)):
|
||||||
pp = self.points[i], self.points[(i+1)%len(self.points)]
|
pp = self.get_points()[i], self.get_points()[(i+1)%len(self.points)]
|
||||||
transform = np.array([
|
transform = np.array([
|
||||||
[pp[0][0], pp[1][0], 0],
|
[pp[0][0], pp[1][0], 0],
|
||||||
[pp[0][1], pp[1][1], 0],
|
[pp[0][1], pp[1][1], 0],
|
||||||
|
@ -148,7 +148,7 @@ class MoserPattern(CircleScene):
|
||||||
self.add(n_equals)
|
self.add(n_equals)
|
||||||
for n in range(1, len(radians)+1):
|
for n in range(1, len(radians)+1):
|
||||||
self.add(*self.dots[:n])
|
self.add(*self.dots[:n])
|
||||||
self.add(*[Line(p[0], p[1]) for p in it.combinations(self.points[:n], 2)])
|
self.add(*[Line(p[0], p[1]) for p in it.combinations(self.get_points()[:n], 2)])
|
||||||
tex_stuffs = [
|
tex_stuffs = [
|
||||||
TexMobject(str(moser_function(n))),
|
TexMobject(str(moser_function(n))),
|
||||||
TexMobject(str(n)).shift(num.get_center())
|
TexMobject(str(n)).shift(num.get_center())
|
||||||
|
@ -357,7 +357,7 @@ class NonGeneralPosition(CircleScene):
|
||||||
center_region = reduce(
|
center_region = reduce(
|
||||||
Region.intersect,
|
Region.intersect,
|
||||||
[
|
[
|
||||||
HalfPlane((self.points[x], self.points[(x+3)%6]))
|
HalfPlane((self.get_points()[x], self.get_points()[(x+3)%6]))
|
||||||
for x in [0, 4, 2]#Ya know, trust it
|
for x in [0, 4, 2]#Ya know, trust it
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -421,7 +421,7 @@ class GeneralPositionRule(Scene):
|
||||||
intersecting_lines = [
|
intersecting_lines = [
|
||||||
line.scale(0.3).set_color()
|
line.scale(0.3).set_color()
|
||||||
for i, j in pairs
|
for i, j in pairs
|
||||||
for line in [Line(cs.points[i], cs.points[j])]
|
for line in [Line(cs.get_points()[i], cs.get_points()[j])]
|
||||||
]
|
]
|
||||||
self.play(*[
|
self.play(*[
|
||||||
ShowCreation(line, run_time = 1.0)
|
ShowCreation(line, run_time = 1.0)
|
||||||
|
@ -558,8 +558,8 @@ class IntersectionPointCorrespondances(CircleScene):
|
||||||
indices.sort()
|
indices.sort()
|
||||||
CircleScene.__init__(self, radians, *args, **kwargs)
|
CircleScene.__init__(self, radians, *args, **kwargs)
|
||||||
intersection_point = intersection(
|
intersection_point = intersection(
|
||||||
(self.points[indices[0]], self.points[indices[2]]),
|
(self.get_points()[indices[0]], self.get_points()[indices[2]]),
|
||||||
(self.points[indices[1]], self.points[indices[3]])
|
(self.get_points()[indices[1]], self.get_points()[indices[3]])
|
||||||
)
|
)
|
||||||
if len(intersection_point) == 2:
|
if len(intersection_point) == 2:
|
||||||
intersection_point = list(intersection_point) + [0]
|
intersection_point = list(intersection_point) + [0]
|
||||||
|
@ -620,8 +620,8 @@ class LinesIntersectOutside(CircleScene):
|
||||||
indices.sort()
|
indices.sort()
|
||||||
CircleScene.__init__(self, radians, *args, **kwargs)
|
CircleScene.__init__(self, radians, *args, **kwargs)
|
||||||
intersection_point = intersection(
|
intersection_point = intersection(
|
||||||
(self.points[indices[0]], self.points[indices[1]]),
|
(self.get_points()[indices[0]], self.get_points()[indices[1]]),
|
||||||
(self.points[indices[2]], self.points[indices[3]])
|
(self.get_points()[indices[2]], self.get_points()[indices[3]])
|
||||||
)
|
)
|
||||||
intersection_point = tuple(list(intersection_point) + [0])
|
intersection_point = tuple(list(intersection_point) + [0])
|
||||||
intersection_dot = Dot(intersection_point)
|
intersection_dot = Dot(intersection_point)
|
||||||
|
@ -636,8 +636,8 @@ class LinesIntersectOutside(CircleScene):
|
||||||
])
|
])
|
||||||
self.play(*[
|
self.play(*[
|
||||||
Transform(
|
Transform(
|
||||||
Line(self.points[indices[p0]], self.points[indices[p1]]),
|
Line(self.get_points()[indices[p0]], self.get_points()[indices[p1]]),
|
||||||
Line(self.points[indices[p0]], intersection_point))
|
Line(self.get_points()[indices[p0]], intersection_point))
|
||||||
for p0, p1 in [(0, 1), (3, 2)]
|
for p0, p1 in [(0, 1), (3, 2)]
|
||||||
] + [ShowCreation(intersection_dot)])
|
] + [ShowCreation(intersection_dot)])
|
||||||
|
|
||||||
|
@ -648,8 +648,8 @@ class QuadrupletsToIntersections(CircleScene):
|
||||||
frame_time = 1.0
|
frame_time = 1.0
|
||||||
for quad in quadruplets:
|
for quad in quadruplets:
|
||||||
intersection_dot = Dot(intersection(
|
intersection_dot = Dot(intersection(
|
||||||
(self.points[quad[0]], self.points[quad[2]]),
|
(self.get_points()[quad[0]], self.get_points()[quad[2]]),
|
||||||
(self.points[quad[1]], self.points[quad[3]])
|
(self.get_points()[quad[1]], self.get_points()[quad[3]])
|
||||||
)).repeat(3)
|
)).repeat(3)
|
||||||
dot_quad = [deepcopy(self.dots[i]) for i in quad]
|
dot_quad = [deepcopy(self.dots[i]) for i in quad]
|
||||||
for dot in dot_quad:
|
for dot in dot_quad:
|
||||||
|
@ -736,8 +736,8 @@ class IntersectCubeGraphEdges(GraphScene):
|
||||||
self.remove(self.edges[0], self.edges[4])
|
self.remove(self.edges[0], self.edges[4])
|
||||||
self.play(*[
|
self.play(*[
|
||||||
Transform(
|
Transform(
|
||||||
Line(self.points[i], self.points[j]),
|
Line(self.get_points()[i], self.get_points()[j]),
|
||||||
CurvedLine(self.points[i], self.points[j]),
|
CurvedLine(self.get_points()[i], self.get_points()[j]),
|
||||||
)
|
)
|
||||||
for i, j in [(0, 1), (5, 4)]
|
for i, j in [(0, 1), (5, 4)]
|
||||||
])
|
])
|
||||||
|
@ -939,14 +939,14 @@ class HowIntersectionChopsLine(CircleScene):
|
||||||
indices.sort()
|
indices.sort()
|
||||||
CircleScene.__init__(self, radians, *args, **kwargs)
|
CircleScene.__init__(self, radians, *args, **kwargs)
|
||||||
intersection_point = intersection(
|
intersection_point = intersection(
|
||||||
(self.points[indices[0]], self.points[indices[2]]),
|
(self.get_points()[indices[0]], self.get_points()[indices[2]]),
|
||||||
(self.points[indices[1]], self.points[indices[3]])
|
(self.get_points()[indices[1]], self.get_points()[indices[3]])
|
||||||
)
|
)
|
||||||
if len(intersection_point) == 2:
|
if len(intersection_point) == 2:
|
||||||
intersection_point = list(intersection_point) + [0]
|
intersection_point = list(intersection_point) + [0]
|
||||||
pairs = list(it.combinations(list(range(len(radians))), 2))
|
pairs = list(it.combinations(list(range(len(radians))), 2))
|
||||||
lines = [
|
lines = [
|
||||||
Line(self.points[indices[p0]], self.points[indices[p1]])
|
Line(self.get_points()[indices[p0]], self.get_points()[indices[p1]])
|
||||||
for p0, p1 in [(2, 0), (1, 3)]
|
for p0, p1 in [(2, 0), (1, 3)]
|
||||||
]
|
]
|
||||||
self.remove(*[
|
self.remove(*[
|
||||||
|
|
|
@ -113,8 +113,8 @@ class Piano(ImageMobject):
|
||||||
x0 = left + count*self.ivory_jump
|
x0 = left + count*self.ivory_jump
|
||||||
x1 = x0 + self.ivory_jump
|
x1 = x0 + self.ivory_jump
|
||||||
key.add_points(
|
key.add_points(
|
||||||
self.points[
|
self.get_points()[
|
||||||
(self.points[:,0] > x0)*(self.points[:,0] < x1)
|
(self.get_points()[:,0] > x0)*(self.get_points()[:,0] < x1)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
keys.append(key)
|
keys.append(key)
|
||||||
|
@ -534,7 +534,7 @@ class FlashOnXProximity(Animation):
|
||||||
|
|
||||||
def interpolate_mobject(self, alpha):
|
def interpolate_mobject(self, alpha):
|
||||||
for mob in self.close_mobjects:
|
for mob in self.close_mobjects:
|
||||||
if np.min(np.abs(mob.points[:,0] - self.x_val)) < 0.1:
|
if np.min(np.abs(mob.get_points()[:,0] - self.x_val)) < 0.1:
|
||||||
self.mobject.set_color()
|
self.mobject.set_color()
|
||||||
return
|
return
|
||||||
self.mobject.to_original_color()
|
self.mobject.to_original_color()
|
||||||
|
|
|
@ -315,7 +315,7 @@ class TauPoem(Scene):
|
||||||
Transform(pi.left_leg, tau.leg),
|
Transform(pi.left_leg, tau.leg),
|
||||||
Transform(
|
Transform(
|
||||||
pi.right_leg,
|
pi.right_leg,
|
||||||
Point(pi.right_leg.points[0,:]).set_color("black")
|
Point(pi.right_leg.get_points()[0,:]).set_color("black")
|
||||||
),
|
),
|
||||||
Transform(pi.mouth, tau.mouth),
|
Transform(pi.mouth, tau.mouth),
|
||||||
CounterclockwiseTransform(
|
CounterclockwiseTransform(
|
||||||
|
@ -327,7 +327,7 @@ class TauPoem(Scene):
|
||||||
def line9(self):
|
def line9(self):
|
||||||
tau = TauCreature()
|
tau = TauCreature()
|
||||||
pi = PiCreature().set_color("red").give_straight_face()
|
pi = PiCreature().set_color("red").give_straight_face()
|
||||||
pi.scale(0.2).move_to(tau.arm.points[-1,:])
|
pi.scale(0.2).move_to(tau.arm.get_points()[-1,:])
|
||||||
point = Point(pi.get_center()).set_color("black")
|
point = Point(pi.get_center()).set_color("black")
|
||||||
vanish_local = 3*(LEFT + UP)
|
vanish_local = 3*(LEFT + UP)
|
||||||
new_pi = deepcopy(pi)
|
new_pi = deepcopy(pi)
|
||||||
|
|
|
@ -73,26 +73,26 @@ class SlideWordDownCycloid(Animation):
|
||||||
if time < cut_offs[0]:
|
if time < cut_offs[0]:
|
||||||
brightness = time/cut_offs[0]
|
brightness = time/cut_offs[0]
|
||||||
letter.rgbas = brightness*np.ones(letter.rgbas.shape)
|
letter.rgbas = brightness*np.ones(letter.rgbas.shape)
|
||||||
position = self.path.points[0]
|
position = self.path.get_points()[0]
|
||||||
angle = 0
|
angle = 0
|
||||||
elif time < cut_offs[1]:
|
elif time < cut_offs[1]:
|
||||||
alpha = (time-cut_offs[0])/(cut_offs[1]-cut_offs[0])
|
alpha = (time-cut_offs[0])/(cut_offs[1]-cut_offs[0])
|
||||||
angle = -rush_into(alpha)*np.pi/2
|
angle = -rush_into(alpha)*np.pi/2
|
||||||
position = self.path.points[0]
|
position = self.path.get_points()[0]
|
||||||
elif time < cut_offs[2]:
|
elif time < cut_offs[2]:
|
||||||
alpha = (time-cut_offs[1])/(cut_offs[2]-cut_offs[1])
|
alpha = (time-cut_offs[1])/(cut_offs[2]-cut_offs[1])
|
||||||
index = int(alpha*self.path.get_num_points())
|
index = int(alpha*self.path.get_num_points())
|
||||||
position = self.path.points[index]
|
position = self.path.get_points()[index]
|
||||||
try:
|
try:
|
||||||
angle = angle_of_vector(
|
angle = angle_of_vector(
|
||||||
self.path.points[index+1] - \
|
self.path.get_points()[index+1] - \
|
||||||
self.path.points[index]
|
self.path.get_points()[index]
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
angle = letter.angle
|
angle = letter.angle
|
||||||
else:
|
else:
|
||||||
alpha = (time-cut_offs[2])/(1-cut_offs[2])
|
alpha = (time-cut_offs[2])/(1-cut_offs[2])
|
||||||
start = self.path.points[-1]
|
start = self.path.get_points()[-1]
|
||||||
end = end_letter.get_bottom()
|
end = end_letter.get_bottom()
|
||||||
position = interpolate(start, end, rush_from(alpha))
|
position = interpolate(start, end, rush_from(alpha))
|
||||||
angle = 0
|
angle = 0
|
||||||
|
@ -206,8 +206,8 @@ class PathSlidingScene(Scene):
|
||||||
|
|
||||||
def add_cycloid_end_points(self):
|
def add_cycloid_end_points(self):
|
||||||
cycloid = Cycloid()
|
cycloid = Cycloid()
|
||||||
point_a = Dot(cycloid.points[0])
|
point_a = Dot(cycloid.get_points()[0])
|
||||||
point_b = Dot(cycloid.points[-1])
|
point_b = Dot(cycloid.get_points()[-1])
|
||||||
A = TexMobject("A").next_to(point_a, LEFT)
|
A = TexMobject("A").next_to(point_a, LEFT)
|
||||||
B = TexMobject("B").next_to(point_b, RIGHT)
|
B = TexMobject("B").next_to(point_b, RIGHT)
|
||||||
self.add(point_a, point_b, A, B)
|
self.add(point_a, point_b, A, B)
|
||||||
|
@ -221,8 +221,8 @@ class TryManyPaths(PathSlidingScene):
|
||||||
self.slider = randy.copy()
|
self.slider = randy.copy()
|
||||||
randy.scale(RANDY_SCALE_FACTOR)
|
randy.scale(RANDY_SCALE_FACTOR)
|
||||||
paths = self.get_paths()
|
paths = self.get_paths()
|
||||||
point_a = Dot(paths[0].points[0])
|
point_a = Dot(paths[0].get_points()[0])
|
||||||
point_b = Dot(paths[0].points[-1])
|
point_b = Dot(paths[0].get_points()[-1])
|
||||||
A = TexMobject("A").next_to(point_a, LEFT)
|
A = TexMobject("A").next_to(point_a, LEFT)
|
||||||
B = TexMobject("B").next_to(point_b, RIGHT)
|
B = TexMobject("B").next_to(point_b, RIGHT)
|
||||||
for point, tex in [(point_a, A), (point_b, B)]:
|
for point, tex in [(point_a, A), (point_b, B)]:
|
||||||
|
@ -288,8 +288,8 @@ class TryManyPaths(PathSlidingScene):
|
||||||
return paths + [cycloid]
|
return paths + [cycloid]
|
||||||
|
|
||||||
def align_paths(self, paths, target_path):
|
def align_paths(self, paths, target_path):
|
||||||
start = target_path.points[0]
|
start = target_path.get_points()[0]
|
||||||
end = target_path.points[-1]
|
end = target_path.get_points()[-1]
|
||||||
for path in paths:
|
for path in paths:
|
||||||
path.put_start_and_end_on(start, end)
|
path.put_start_and_end_on(start, end)
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ class NotTheCircle(PathSlidingScene):
|
||||||
angle = 2*np.pi/3
|
angle = 2*np.pi/3
|
||||||
path = Arc(angle, radius = 3)
|
path = Arc(angle, radius = 3)
|
||||||
path.set_color_by_gradient(RED_D, WHITE)
|
path.set_color_by_gradient(RED_D, WHITE)
|
||||||
radius = Line(ORIGIN, path.points[0])
|
radius = Line(ORIGIN, path.get_points()[0])
|
||||||
randy = Randolph()
|
randy = Randolph()
|
||||||
randy.scale(RANDY_SCALE_FACTOR)
|
randy.scale(RANDY_SCALE_FACTOR)
|
||||||
randy.shift(-randy.get_bottom())
|
randy.shift(-randy.get_bottom())
|
||||||
|
@ -582,8 +582,8 @@ class ThetaTInsteadOfXY(Scene):
|
||||||
def construct(self):
|
def construct(self):
|
||||||
cycloid = Cycloid()
|
cycloid = Cycloid()
|
||||||
index = cycloid.get_num_points()/3
|
index = cycloid.get_num_points()/3
|
||||||
point = cycloid.points[index]
|
point = cycloid.get_points()[index]
|
||||||
vect = cycloid.points[index+1]-point
|
vect = cycloid.get_points()[index+1]-point
|
||||||
vect /= get_norm(vect)
|
vect /= get_norm(vect)
|
||||||
vect *= 3
|
vect *= 3
|
||||||
vect_mob = Vector(point, vect)
|
vect_mob = Vector(point, vect)
|
||||||
|
|
|
@ -63,7 +63,7 @@ class CycloidScene(Scene):
|
||||||
self.play(
|
self.play(
|
||||||
RollAlongVector(
|
RollAlongVector(
|
||||||
self.circle,
|
self.circle,
|
||||||
self.cycloid.points[-1]-self.cycloid.points[0],
|
self.cycloid.get_points()[-1]-self.cycloid.get_points()[0],
|
||||||
**kwargs
|
**kwargs
|
||||||
),
|
),
|
||||||
ShowCreation(self.cycloid, **kwargs),
|
ShowCreation(self.cycloid, **kwargs),
|
||||||
|
@ -75,7 +75,7 @@ class CycloidScene(Scene):
|
||||||
self.play(
|
self.play(
|
||||||
RollAlongVector(
|
RollAlongVector(
|
||||||
self.circle,
|
self.circle,
|
||||||
self.cycloid.points[0]-self.cycloid.points[- 1],
|
self.cycloid.get_points()[0]-self.cycloid.get_points()[- 1],
|
||||||
rotation_vector = IN,
|
rotation_vector = IN,
|
||||||
**kwargs
|
**kwargs
|
||||||
),
|
),
|
||||||
|
@ -136,7 +136,7 @@ class IntroduceCycloid(CycloidScene):
|
||||||
q_marks, arrows = result = [Mobject(), Mobject()]
|
q_marks, arrows = result = [Mobject(), Mobject()]
|
||||||
for x in range(n_marks):
|
for x in range(n_marks):
|
||||||
index = (x+0.5)*self.cycloid.get_num_points()/n_marks
|
index = (x+0.5)*self.cycloid.get_num_points()/n_marks
|
||||||
q_point = self.cycloid.points[index]
|
q_point = self.cycloid.get_points()[index]
|
||||||
vect = q_point-mob.get_center()
|
vect = q_point-mob.get_center()
|
||||||
start_point = circle.get_boundary_point(vect)
|
start_point = circle.get_boundary_point(vect)
|
||||||
arrow = Arrow(
|
arrow = Arrow(
|
||||||
|
@ -178,7 +178,7 @@ class LeviSolution(CycloidScene):
|
||||||
|
|
||||||
def init_points(self):
|
def init_points(self):
|
||||||
index = int(self.cycloid_fraction*self.cycloid.get_num_points())
|
index = int(self.cycloid_fraction*self.cycloid.get_num_points())
|
||||||
p_point = self.cycloid.points[index]
|
p_point = self.cycloid.get_points()[index]
|
||||||
p_dot = Dot(p_point)
|
p_dot = Dot(p_point)
|
||||||
p_label = TexMobject("P")
|
p_label = TexMobject("P")
|
||||||
p_label.next_to(p_dot, DOWN+LEFT)
|
p_label.next_to(p_dot, DOWN+LEFT)
|
||||||
|
@ -557,7 +557,7 @@ class SlidingObject(CycloidScene, PathSlidingScene):
|
||||||
end_time,
|
end_time,
|
||||||
RollAlongVector(
|
RollAlongVector(
|
||||||
self.circle,
|
self.circle,
|
||||||
self.cycloid.points[-1]-self.cycloid.points[0],
|
self.cycloid.get_points()[-1]-self.cycloid.get_points()[0],
|
||||||
run_time = end_time-start_time,
|
run_time = end_time-start_time,
|
||||||
rate_func=linear
|
rate_func=linear
|
||||||
)
|
)
|
||||||
|
|
|
@ -46,7 +46,7 @@ def sort_by_color(mob):
|
||||||
mob.rgbas
|
mob.rgbas
|
||||||
))
|
))
|
||||||
mob.rgbas = mob.rgbas[indices]
|
mob.rgbas = mob.rgbas[indices]
|
||||||
mob.points = mob.points[indices]
|
mob.points = mob.get_points()[indices]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,10 +84,10 @@ def nearest_neighbor_align(mobject1, mobject2):
|
||||||
for n in range(mobject1.get_num_points()):
|
for n in range(mobject1.get_num_points()):
|
||||||
indices = (closest_point_indices == n)
|
indices = (closest_point_indices == n)
|
||||||
new_mob1.add_points(
|
new_mob1.add_points(
|
||||||
[mobject1.points[n]]*sum(indices)
|
[mobject1.get_points()[n]]*sum(indices)
|
||||||
)
|
)
|
||||||
new_mob2.add_points(
|
new_mob2.add_points(
|
||||||
mobject2.points[indices],
|
mobject2.get_points()[indices],
|
||||||
rgbas = mobject2.rgbas[indices]
|
rgbas = mobject2.rgbas[indices]
|
||||||
)
|
)
|
||||||
return new_mob1, new_mob2
|
return new_mob1, new_mob2
|
||||||
|
|
|
@ -306,8 +306,8 @@ class MultilayeredGlass(PhotonScene, ZoomedScene):
|
||||||
0, self.cycloid.get_num_points()-1, 10
|
0, self.cycloid.get_num_points()-1, 10
|
||||||
)
|
)
|
||||||
for index in indices:
|
for index in indices:
|
||||||
point = self.cycloid.points[index]
|
point = self.cycloid.get_points()[index]
|
||||||
next_point = self.cycloid.points[index+1]
|
next_point = self.cycloid.get_points()[index+1]
|
||||||
angle = angle_of_vector(point - next_point)
|
angle = angle_of_vector(point - next_point)
|
||||||
for mob in little_square, line:
|
for mob in little_square, line:
|
||||||
mob.shift(point - mob.get_center())
|
mob.shift(point - mob.get_center())
|
||||||
|
|
|
@ -29,7 +29,7 @@ class PhotonScene(Scene):
|
||||||
def wavify(self, mobject):
|
def wavify(self, mobject):
|
||||||
result = mobject.copy()
|
result = mobject.copy()
|
||||||
result.ingest_submobjects()
|
result.ingest_submobjects()
|
||||||
tangent_vectors = result.points[1:]-result.points[:-1]
|
tangent_vectors = result.get_points()[1:]-result.get_points()[:-1]
|
||||||
lengths = np.apply_along_axis(
|
lengths = np.apply_along_axis(
|
||||||
get_norm, 1, tangent_vectors
|
get_norm, 1, tangent_vectors
|
||||||
)
|
)
|
||||||
|
@ -42,7 +42,7 @@ class PhotonScene(Scene):
|
||||||
nudge_sizes = 0.1*np.sin(2*np.pi*times)
|
nudge_sizes = 0.1*np.sin(2*np.pi*times)
|
||||||
thick_nudge_sizes = nudge_sizes.repeat(3).reshape((len(nudge_sizes), 3))
|
thick_nudge_sizes = nudge_sizes.repeat(3).reshape((len(nudge_sizes), 3))
|
||||||
nudges = thick_nudge_sizes*normal_vectors
|
nudges = thick_nudge_sizes*normal_vectors
|
||||||
result.points[1:] += nudges
|
result.get_points()[1:] += nudges
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ class ShowMultiplePathsInWater(ShowMultiplePathsScene):
|
||||||
straight = Line(self.start_point, self.end_point)
|
straight = Line(self.start_point, self.end_point)
|
||||||
slow = TextMobject("Slow")
|
slow = TextMobject("Slow")
|
||||||
slow.rotate(np.arctan(straight.get_slope()))
|
slow.rotate(np.arctan(straight.get_slope()))
|
||||||
slow.shift(straight.points[int(0.7*straight.get_num_points())])
|
slow.shift(straight.get_points()[int(0.7*straight.get_num_points())])
|
||||||
slow.shift(0.5*DOWN)
|
slow.shift(0.5*DOWN)
|
||||||
too_long = TextMobject("Too long")
|
too_long = TextMobject("Too long")
|
||||||
too_long.shift(UP)
|
too_long.shift(UP)
|
||||||
|
@ -367,7 +367,7 @@ class StraightLinesFastestInConstantMedium(PhotonScene):
|
||||||
end = 2*np.pi
|
end = 2*np.pi
|
||||||
)
|
)
|
||||||
squaggle.shift(2*UP)
|
squaggle.shift(2*UP)
|
||||||
start, end = squaggle.points[0], squaggle.points[-1]
|
start, end = squaggle.get_points()[0], squaggle.get_points()[-1]
|
||||||
line = Line(start, end)
|
line = Line(start, end)
|
||||||
result = [squaggle, line]
|
result = [squaggle, line]
|
||||||
for mob in result:
|
for mob in result:
|
||||||
|
@ -465,12 +465,12 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater):
|
||||||
top_dist.scale(0.5)
|
top_dist.scale(0.5)
|
||||||
a = 0.3
|
a = 0.3
|
||||||
n = top_line.get_num_points()
|
n = top_line.get_num_points()
|
||||||
point = top_line.points[int(a*n)]
|
point = top_line.get_points()[int(a*n)]
|
||||||
top_dist.next_to(Point(point), RIGHT, buff = 0.3)
|
top_dist.next_to(Point(point), RIGHT, buff = 0.3)
|
||||||
bottom_dist = TexMobject("\\sqrt{h_2^2+(w-x)^2}")
|
bottom_dist = TexMobject("\\sqrt{h_2^2+(w-x)^2}")
|
||||||
bottom_dist.scale(0.5)
|
bottom_dist.scale(0.5)
|
||||||
n = bottom_line.get_num_points()
|
n = bottom_line.get_num_points()
|
||||||
point = bottom_line.points[int((1-a)*n)]
|
point = bottom_line.get_points()[int((1-a)*n)]
|
||||||
bottom_dist.next_to(Point(point), LEFT, buff = 1)
|
bottom_dist.next_to(Point(point), LEFT, buff = 1)
|
||||||
|
|
||||||
end_top_line = Line(self.start_point, end_x)
|
end_top_line = Line(self.start_point, end_x)
|
||||||
|
@ -494,7 +494,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater):
|
||||||
axes, UP
|
axes, UP
|
||||||
))
|
))
|
||||||
new_graph = graph.copy()
|
new_graph = graph.copy()
|
||||||
midpoint = new_graph.points[new_graph.get_num_points()/2]
|
midpoint = new_graph.get_points()[new_graph.get_num_points()/2]
|
||||||
new_graph.filter_out(lambda p : p[0] < midpoint[0])
|
new_graph.filter_out(lambda p : p[0] < midpoint[0])
|
||||||
new_graph.reverse_points()
|
new_graph.reverse_points()
|
||||||
pairs_for_end_transform = [
|
pairs_for_end_transform = [
|
||||||
|
@ -549,7 +549,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater):
|
||||||
step = self.frame_duration/run_time
|
step = self.frame_duration/run_time
|
||||||
for a in smooth(np.arange(0, 1-step, step)):
|
for a in smooth(np.arange(0, 1-step, step)):
|
||||||
index = int(a*graph.get_num_points())
|
index = int(a*graph.get_num_points())
|
||||||
p1, p2 = graph.points[index], graph.points[index+1]
|
p1, p2 = graph.get_points()[index], graph.get_points()[index+1]
|
||||||
line = Line(LEFT, RIGHT)
|
line = Line(LEFT, RIGHT)
|
||||||
line.rotate(angle_of_vector(p2-p1))
|
line.rotate(angle_of_vector(p2-p1))
|
||||||
line.shift(p1)
|
line.shift(p1)
|
||||||
|
@ -666,7 +666,7 @@ class SpringSetup(ShowMultiplePathsInWater):
|
||||||
circle = Circle(color = next(colors))
|
circle = Circle(color = next(colors))
|
||||||
circle.reverse_points()
|
circle.reverse_points()
|
||||||
circle.scale(spring.loop_radius)
|
circle.scale(spring.loop_radius)
|
||||||
circle.shift(spring.points[0])
|
circle.shift(spring.get_points()[0])
|
||||||
|
|
||||||
self.play(Transform(circle, spring))
|
self.play(Transform(circle, spring))
|
||||||
self.remove(circle)
|
self.remove(circle)
|
||||||
|
|
|
@ -230,7 +230,7 @@ class ThetaTGraph(Scene):
|
||||||
graph = ParametricCurve(
|
graph = ParametricCurve(
|
||||||
lambda t : 4*t*RIGHT + 2*smooth(t)*UP
|
lambda t : 4*t*RIGHT + 2*smooth(t)*UP
|
||||||
)
|
)
|
||||||
line = Line(graph.points[0], graph.points[-1], color = WHITE)
|
line = Line(graph.get_points()[0], graph.get_points()[-1], color = WHITE)
|
||||||
q_mark = TextMobject("?")
|
q_mark = TextMobject("?")
|
||||||
q_mark.next_to(Point(graph.get_center()), LEFT)
|
q_mark.next_to(Point(graph.get_center()), LEFT)
|
||||||
stars = Stars(color = BLACK)
|
stars = Stars(color = BLACK)
|
||||||
|
@ -384,7 +384,7 @@ class ShortestPathProblem(Scene):
|
||||||
end = 2*np.pi
|
end = 2*np.pi
|
||||||
)
|
)
|
||||||
path.scale(6/(2*np.pi))
|
path.scale(6/(2*np.pi))
|
||||||
path.shift(point_a - path.points[0])
|
path.shift(point_a - path.get_points()[0])
|
||||||
path.set_color(RED)
|
path.set_color(RED)
|
||||||
line = Line(point_a, point_b)
|
line = Line(point_a, point_b)
|
||||||
words = TextMobject("Shortest path from $A$ to $B$")
|
words = TextMobject("Shortest path from $A$ to $B$")
|
||||||
|
|
|
@ -421,7 +421,7 @@ class ContinuouslyObeyingSnellsLaw(MultilayeredScene):
|
||||||
|
|
||||||
|
|
||||||
def show_equation(self, chopped_cycloid, ref_mob):
|
def show_equation(self, chopped_cycloid, ref_mob):
|
||||||
point2, point1 = chopped_cycloid.points[-2:]
|
point2, point1 = chopped_cycloid.get_points()[-2:]
|
||||||
arc, theta, vert_line, tangent_line = self.get_marks(
|
arc, theta, vert_line, tangent_line = self.get_marks(
|
||||||
point1, point2
|
point1, point2
|
||||||
)
|
)
|
||||||
|
|
|
@ -19,7 +19,7 @@ class FractalCreation(Scene):
|
||||||
order = order,
|
order = order,
|
||||||
**self.fractal_kwargs
|
**self.fractal_kwargs
|
||||||
)
|
)
|
||||||
fractal.align_data(new_fractal)
|
fractal.align_data_and_family(new_fractal)
|
||||||
self.play(Transform(
|
self.play(Transform(
|
||||||
fractal, new_fractal,
|
fractal, new_fractal,
|
||||||
**self.transform_kwargs
|
**self.transform_kwargs
|
||||||
|
|
|
@ -1172,7 +1172,7 @@ class BinaryCountingAtEveryScale(Scene):
|
||||||
], run_time = 1)
|
], run_time = 1)
|
||||||
|
|
||||||
for bit_mob in bit_mobs:
|
for bit_mob in bit_mobs:
|
||||||
curr_bits.align_data(bit_mob)
|
curr_bits.align_data_and_family(bit_mob)
|
||||||
bit_mob.set_color(YELLOW)
|
bit_mob.set_color(YELLOW)
|
||||||
bit_mob[0].set_color(MAROON_B)
|
bit_mob[0].set_color(MAROON_B)
|
||||||
self.play(get_run_through(bit_mobs[1:2**(self.num_bits-1)]))
|
self.play(get_run_through(bit_mobs[1:2**(self.num_bits-1)]))
|
||||||
|
@ -1359,7 +1359,7 @@ class IntroduceSolveByCounting(TowersOfHanoiScene):
|
||||||
self.curr_bit_mob = next(self.bit_mobs_iter)
|
self.curr_bit_mob = next(self.bit_mobs_iter)
|
||||||
|
|
||||||
for bit_mob in bit_mobs:
|
for bit_mob in bit_mobs:
|
||||||
bit_mob.align_data(self.curr_bit_mob)
|
bit_mob.align_data_and_family(self.curr_bit_mob)
|
||||||
for bit, disk in zip(bit_mob, reversed(list(self.disks))):
|
for bit, disk in zip(bit_mob, reversed(list(self.disks))):
|
||||||
bit.set_color(disk.get_color())
|
bit.set_color(disk.get_color())
|
||||||
bit_mobs.next_to(self.peg_labels, DOWN)
|
bit_mobs.next_to(self.peg_labels, DOWN)
|
||||||
|
@ -2431,7 +2431,7 @@ class TernaryCountingSelfSimilarPattern(Scene):
|
||||||
curr_ternary_mob = next(ternary_mob_iter)
|
curr_ternary_mob = next(ternary_mob_iter)
|
||||||
|
|
||||||
for trits in ternary_mobs:
|
for trits in ternary_mobs:
|
||||||
trits.align_data(curr_ternary_mob)
|
trits.align_data_and_family(curr_ternary_mob)
|
||||||
for trit, color in zip(trits, colors):
|
for trit, color in zip(trits, colors):
|
||||||
trit.set_color(color)
|
trit.set_color(color)
|
||||||
def get_increment():
|
def get_increment():
|
||||||
|
@ -2488,7 +2488,7 @@ class SolveConstrainedWithTernaryCounting(ConstrainedTowersOfHanoiScene):
|
||||||
ternary_mobs.next_to(self.peg_labels, DOWN)
|
ternary_mobs.next_to(self.peg_labels, DOWN)
|
||||||
|
|
||||||
for trits in ternary_mobs:
|
for trits in ternary_mobs:
|
||||||
trits.align_data(ternary_mobs[0])
|
trits.align_data_and_family(ternary_mobs[0])
|
||||||
trits.set_color_by_gradient(*self.disk_start_and_end_colors)
|
trits.set_color_by_gradient(*self.disk_start_and_end_colors)
|
||||||
self.ternary_mob_iter = it.cycle(ternary_mobs)
|
self.ternary_mob_iter = it.cycle(ternary_mobs)
|
||||||
self.curr_ternary_mob = self.ternary_mob_iter.next().copy()
|
self.curr_ternary_mob = self.ternary_mob_iter.next().copy()
|
||||||
|
|
|
@ -235,7 +235,7 @@ class FromKochToSpaceFilling(Scene):
|
||||||
2*(np.pi/2 - curve.angle),
|
2*(np.pi/2 - curve.angle),
|
||||||
radius = r,
|
radius = r,
|
||||||
start_angle = np.pi+curve.angle
|
start_angle = np.pi+curve.angle
|
||||||
).shift(curve.points[curve.get_num_points()/2])
|
).shift(curve.get_points()[curve.get_num_points()/2])
|
||||||
for curve, r in zip(curves, [0.6, 0.7, 0.4])
|
for curve, r in zip(curves, [0.6, 0.7, 0.4])
|
||||||
]
|
]
|
||||||
theta = TexMobject("\\theta")
|
theta = TexMobject("\\theta")
|
||||||
|
|
|
@ -489,7 +489,7 @@ class RandomMapping(Scene):
|
||||||
# for mob in grid, freq_line:
|
# for mob in grid, freq_line:
|
||||||
# indices = np.arange(mob.get_num_points())
|
# indices = np.arange(mob.get_num_points())
|
||||||
# random.shuffle(indices)
|
# random.shuffle(indices)
|
||||||
# mob.points = mob.points[indices]
|
# mob.points = mob.get_points()[indices]
|
||||||
stars = Stars(stroke_width = grid.stroke_width)
|
stars = Stars(stroke_width = grid.stroke_width)
|
||||||
|
|
||||||
self.add(grid)
|
self.add(grid)
|
||||||
|
@ -615,7 +615,7 @@ class WeaveLineThroughPixels(Scene):
|
||||||
fraction_along_curve = index_along_curve/float(curve.get_num_points())
|
fraction_along_curve = index_along_curve/float(curve.get_num_points())
|
||||||
target = square.copy().center().scale(0.8/(2**order))
|
target = square.copy().center().scale(0.8/(2**order))
|
||||||
line_index = int(fraction_along_curve*line.get_num_points())
|
line_index = int(fraction_along_curve*line.get_num_points())
|
||||||
target.shift(line.points[line_index])
|
target.shift(line.get_points()[line_index])
|
||||||
targets.add(target)
|
targets.add(target)
|
||||||
|
|
||||||
|
|
||||||
|
@ -766,7 +766,7 @@ class Order2PseudoHilbertCurve(Scene):
|
||||||
last_curve = mini_curves[0]
|
last_curve = mini_curves[0]
|
||||||
naive_curve = Mobject(last_curve)
|
naive_curve = Mobject(last_curve)
|
||||||
for mini_curve in mini_curves[1:]:
|
for mini_curve in mini_curves[1:]:
|
||||||
line = Line(last_curve.points[-1], mini_curve.points[0])
|
line = Line(last_curve.get_points()[-1], mini_curve.get_points()[0])
|
||||||
naive_curve.add(line, mini_curve)
|
naive_curve.add(line, mini_curve)
|
||||||
last_curve = mini_curve
|
last_curve = mini_curve
|
||||||
naive_curve.ingest_submobjects()
|
naive_curve.ingest_submobjects()
|
||||||
|
@ -986,7 +986,7 @@ class IncreasingResolutionWithSnakeCurve(Scene):
|
||||||
start_dots, end_dots = [
|
start_dots, end_dots = [
|
||||||
Mobject(*[
|
Mobject(*[
|
||||||
Dot(
|
Dot(
|
||||||
curve.points[int(x*curve.get_num_points())],
|
curve.get_points()[int(x*curve.get_num_points())],
|
||||||
color = color
|
color = color
|
||||||
)
|
)
|
||||||
for x, color in [
|
for x, color in [
|
||||||
|
@ -1024,7 +1024,7 @@ class TrackSpecificCurvePoint(Scene):
|
||||||
dot = Dot(UP)
|
dot = Dot(UP)
|
||||||
start_dot = Dot(0.1*LEFT)
|
start_dot = Dot(0.1*LEFT)
|
||||||
dots = [
|
dots = [
|
||||||
Dot(curve.points[alpha*curve.get_num_points()])
|
Dot(curve.get_points()[alpha*curve.get_num_points()])
|
||||||
for curve in curves
|
for curve in curves
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class HilbertCurveIsPerfect(Scene):
|
||||||
)
|
)
|
||||||
colored_curve.rgbas = sparce_lion.rgbas[closest_point_indices]
|
colored_curve.rgbas = sparce_lion.rgbas[closest_point_indices]
|
||||||
line = Line(5*LEFT, 5*RIGHT)
|
line = Line(5*LEFT, 5*RIGHT)
|
||||||
Mobject.align_data(line, colored_curve)
|
Mobject.align_data_and_family(line, colored_curve)
|
||||||
line.rgbas = colored_curve.rgbas
|
line.rgbas = colored_curve.rgbas
|
||||||
|
|
||||||
self.add(lion)
|
self.add(lion)
|
||||||
|
@ -246,7 +246,7 @@ class DefinitionOfCurve(Scene):
|
||||||
fine_curve.replace(curve)
|
fine_curve.replace(curve)
|
||||||
dots = Mobject(*[
|
dots = Mobject(*[
|
||||||
Dot(
|
Dot(
|
||||||
curve.points[n*curve.get_num_points()/15],
|
curve.get_points()[n*curve.get_num_points()/15],
|
||||||
color = YELLOW_C
|
color = YELLOW_C
|
||||||
)
|
)
|
||||||
for n in range(1, 15)
|
for n in range(1, 15)
|
||||||
|
@ -411,9 +411,9 @@ class PseudoHilbertCurveAsFunctionExample(Scene):
|
||||||
for mob in curve, grid:
|
for mob in curve, grid:
|
||||||
mob.scale(0.7)
|
mob.scale(0.7)
|
||||||
index = int(0.3*line.get_num_points())
|
index = int(0.3*line.get_num_points())
|
||||||
dot1 = Dot(line.points[index])
|
dot1 = Dot(line.get_points()[index])
|
||||||
arrow1 = Arrow(arg, dot1, buff = 0.1)
|
arrow1 = Arrow(arg, dot1, buff = 0.1)
|
||||||
dot2 = Dot(curve.points[index])
|
dot2 = Dot(curve.get_points()[index])
|
||||||
arrow2 = Arrow(result.get_bottom(), dot2, buff = 0.1)
|
arrow2 = Arrow(result.get_bottom(), dot2, buff = 0.1)
|
||||||
|
|
||||||
self.add(phc)
|
self.add(phc)
|
||||||
|
@ -487,7 +487,7 @@ class FormalDefinitionOfContinuity(Scene):
|
||||||
lambda t : 5.5*RIGHT + UP - 2*spiril(1-t),
|
lambda t : 5.5*RIGHT + UP - 2*spiril(1-t),
|
||||||
density = 5*DEFAULT_POINT_DENSITY_1D,
|
density = 5*DEFAULT_POINT_DENSITY_1D,
|
||||||
)
|
)
|
||||||
Mobject.align_data(self.spiril1, self.spiril2)
|
Mobject.align_data_and_family(self.spiril1, self.spiril2)
|
||||||
self.output = Mobject(self.spiril1, self.spiril2)
|
self.output = Mobject(self.spiril1, self.spiril2)
|
||||||
self.output.ingest_submobjects()
|
self.output.ingest_submobjects()
|
||||||
self.output.set_color(GREEN_A)
|
self.output.set_color(GREEN_A)
|
||||||
|
@ -522,10 +522,10 @@ class FormalDefinitionOfContinuity(Scene):
|
||||||
output_points = Mobject(color = self.output_color)
|
output_points = Mobject(color = self.output_color)
|
||||||
n = self.output.get_num_points()
|
n = self.output.get_num_points()
|
||||||
output_points.add_points(
|
output_points.add_points(
|
||||||
self.output.points[int(min_input*n):int(max_input*n)]
|
self.output.get_points()[int(min_input*n):int(max_input*n)]
|
||||||
)
|
)
|
||||||
output_center = output_points.points[int(0.5*output_points.get_num_points())]
|
output_center = output_points.get_points()[int(0.5*output_points.get_num_points())]
|
||||||
max_distance = get_norm(output_center-output_points.points[-1])
|
max_distance = get_norm(output_center-output_points.get_points()[-1])
|
||||||
output_circle = Circle(
|
output_circle = Circle(
|
||||||
radius = max_distance,
|
radius = max_distance,
|
||||||
color = WHITE
|
color = WHITE
|
||||||
|
@ -572,8 +572,8 @@ class FormalDefinitionOfContinuity(Scene):
|
||||||
|
|
||||||
def label_jump(self):
|
def label_jump(self):
|
||||||
jump_points = Mobject(
|
jump_points = Mobject(
|
||||||
Point(self.spiril1.points[-1]),
|
Point(self.spiril1.get_points()[-1]),
|
||||||
Point(self.spiril2.points[0])
|
Point(self.spiril2.get_points()[0])
|
||||||
)
|
)
|
||||||
self.brace = Brace(jump_points, RIGHT)
|
self.brace = Brace(jump_points, RIGHT)
|
||||||
self.jump = TextMobject("Jump")
|
self.jump = TextMobject("Jump")
|
||||||
|
@ -817,7 +817,7 @@ class WonderfulPropertyOfPseudoHilbertCurves(Scene):
|
||||||
for num in range(2,9):
|
for num in range(2,9):
|
||||||
new_curve = HilbertCurve(order = num)
|
new_curve = HilbertCurve(order = num)
|
||||||
new_curve.scale(0.8)
|
new_curve.scale(0.8)
|
||||||
new_dot = Dot(new_curve.points[int(val*new_curve.get_num_points())])
|
new_dot = Dot(new_curve.get_points()[int(val*new_curve.get_num_points())])
|
||||||
new_num_str = TexMobject(str(num)).replace(num_str)
|
new_num_str = TexMobject(str(num)).replace(num_str)
|
||||||
self.play(
|
self.play(
|
||||||
Transform(curve, new_curve),
|
Transform(curve, new_curve),
|
||||||
|
@ -874,7 +874,7 @@ class FollowManyPoints(Scene):
|
||||||
new_curve = HilbertCurve(order = num)
|
new_curve = HilbertCurve(order = num)
|
||||||
new_curve.scale(0.8)
|
new_curve.scale(0.8)
|
||||||
new_dots = Mobject(*[
|
new_dots = Mobject(*[
|
||||||
Dot(new_curve.points[int(val*new_curve.get_num_points())])
|
Dot(new_curve.get_points()[int(val*new_curve.get_num_points())])
|
||||||
for val in vals
|
for val in vals
|
||||||
])
|
])
|
||||||
self.play(
|
self.play(
|
||||||
|
@ -924,7 +924,7 @@ class FormalDefinitionOfHilbertCurve(Scene):
|
||||||
for num in range(1, 9):
|
for num in range(1, 9):
|
||||||
new_curve = HilbertCurve(order = num)
|
new_curve = HilbertCurve(order = num)
|
||||||
new_curve.scale(0.8)
|
new_curve.scale(0.8)
|
||||||
new_dot = Dot(new_curve.points[int(val*new_curve.get_num_points())])
|
new_dot = Dot(new_curve.get_points()[int(val*new_curve.get_num_points())])
|
||||||
self.play(
|
self.play(
|
||||||
Transform(curve, new_curve),
|
Transform(curve, new_curve),
|
||||||
Transform(dot, new_dot),
|
Transform(dot, new_dot),
|
||||||
|
|
|
@ -581,8 +581,8 @@ class IntegrationByParts(Scene):
|
||||||
v_lines, h_lines = VGroup(), VGroup()
|
v_lines, h_lines = VGroup(), VGroup()
|
||||||
for alpha in np.linspace(0, 1, 30):
|
for alpha in np.linspace(0, 1, 30):
|
||||||
point = curve.point_from_proportion(alpha)
|
point = curve.point_from_proportion(alpha)
|
||||||
top_point = curve.points[0][1]*UP + point[0]*RIGHT
|
top_point = curve.get_points()[0][1]*UP + point[0]*RIGHT
|
||||||
left_point = curve.points[0][0]*RIGHT + point[1]*UP
|
left_point = curve.get_points()[0][0]*RIGHT + point[1]*UP
|
||||||
v_lines.add(Line(top_point, point))
|
v_lines.add(Line(top_point, point))
|
||||||
h_lines.add(Line(left_point, point))
|
h_lines.add(Line(left_point, point))
|
||||||
v_lines.set_color(BLUE_E)
|
v_lines.set_color(BLUE_E)
|
||||||
|
@ -643,13 +643,13 @@ class IntegrationByParts(Scene):
|
||||||
)
|
)
|
||||||
coords.set_color_by_tex("0.00", BLACK)
|
coords.set_color_by_tex("0.00", BLACK)
|
||||||
dot = Dot(radius = 0.1)
|
dot = Dot(radius = 0.1)
|
||||||
dot.move_to(curve.points[0])
|
dot.move_to(curve.get_points()[0])
|
||||||
coords.next_to(dot, UP+RIGHT)
|
coords.next_to(dot, UP+RIGHT)
|
||||||
self.play(
|
self.play(
|
||||||
ShowCreation(curve),
|
ShowCreation(curve),
|
||||||
UpdateFromFunc(
|
UpdateFromFunc(
|
||||||
dot,
|
dot,
|
||||||
lambda d : d.move_to(curve.points[-1])
|
lambda d : d.move_to(curve.get_points()[-1])
|
||||||
),
|
),
|
||||||
MaintainPositionRelativeTo(coords, dot),
|
MaintainPositionRelativeTo(coords, dot),
|
||||||
run_time = 5,
|
run_time = 5,
|
||||||
|
|
|
@ -991,8 +991,8 @@ class DeformToInterval(ClosedLoopScene):
|
||||||
self.loop.to_edge(UP)
|
self.loop.to_edge(UP)
|
||||||
original_loop = self.loop.copy()
|
original_loop = self.loop.copy()
|
||||||
cut_loop = self.loop.copy()
|
cut_loop = self.loop.copy()
|
||||||
cut_loop.points[0] += 0.3*(UP+RIGHT)
|
cut_loop.get_points()[0] += 0.3*(UP+RIGHT)
|
||||||
cut_loop.points[-1] += 0.3*(DOWN+RIGHT)
|
cut_loop.get_points()[-1] += 0.3*(DOWN+RIGHT)
|
||||||
|
|
||||||
#Unwrap loop
|
#Unwrap loop
|
||||||
self.transform_loop(cut_loop, path_arc = np.pi)
|
self.transform_loop(cut_loop, path_arc = np.pi)
|
||||||
|
@ -1036,7 +1036,7 @@ class DeformToInterval(ClosedLoopScene):
|
||||||
self.loop = original_loop
|
self.loop = original_loop
|
||||||
self.dots = dots_copy
|
self.dots = dots_copy
|
||||||
dot_at_1 = self.dots[-1]
|
dot_at_1 = self.dots[-1]
|
||||||
dot_at_1.target.move_to(cut_loop.points[-1])
|
dot_at_1.target.move_to(cut_loop.get_points()[-1])
|
||||||
self.transform_loop(
|
self.transform_loop(
|
||||||
cut_loop,
|
cut_loop,
|
||||||
added_anims = [MoveToTarget(dot_at_1)]
|
added_anims = [MoveToTarget(dot_at_1)]
|
||||||
|
@ -1291,7 +1291,7 @@ class EndpointsGluedTogether(ClosedLoopScene):
|
||||||
self.transform_loop(
|
self.transform_loop(
|
||||||
original_loop,
|
original_loop,
|
||||||
added_anims = [
|
added_anims = [
|
||||||
ApplyMethod(dot.move_to, original_loop.points[0])
|
ApplyMethod(dot.move_to, original_loop.get_points()[0])
|
||||||
for dot in dots
|
for dot in dots
|
||||||
],
|
],
|
||||||
run_time = 3
|
run_time = 3
|
||||||
|
@ -1729,7 +1729,7 @@ class PrepareForMobiusStrip(Scene):
|
||||||
)
|
)
|
||||||
self.wait()
|
self.wait()
|
||||||
self.play(*[
|
self.play(*[
|
||||||
ApplyMethod(tri.shift, tri.points[0][0]*LEFT)
|
ApplyMethod(tri.shift, tri.get_points()[0][0]*LEFT)
|
||||||
for tri in self.triangles
|
for tri in self.triangles
|
||||||
])
|
])
|
||||||
self.play(*[
|
self.play(*[
|
||||||
|
|
|
@ -788,9 +788,9 @@ class RiemannFatherOfComplex(ComplexTransformationScene):
|
||||||
arc = Arc(-2*np.pi/3)
|
arc = Arc(-2*np.pi/3)
|
||||||
arc.rotate(-np.pi)
|
arc.rotate(-np.pi)
|
||||||
arc.add_tip()
|
arc.add_tip()
|
||||||
arc.shift(input_dot.get_top()-arc.points[0]+SMALL_BUFF*UP)
|
arc.shift(input_dot.get_top()-arc.get_points()[0]+SMALL_BUFF*UP)
|
||||||
output_dot = Dot(
|
output_dot = Dot(
|
||||||
arc.points[-1] + SMALL_BUFF*(2*RIGHT+DOWN),
|
arc.get_points()[-1] + SMALL_BUFF*(2*RIGHT+DOWN),
|
||||||
color = MAROON_B
|
color = MAROON_B
|
||||||
)
|
)
|
||||||
for dot, tex in (input_dot, "z"), (output_dot, "f(z)"):
|
for dot, tex in (input_dot, "z"), (output_dot, "f(z)"):
|
||||||
|
@ -1660,7 +1660,7 @@ class VisualizingSSquared(ComplexTransformationScene):
|
||||||
lambda t : self.z_to_point(z**(1.1+0.8*t))
|
lambda t : self.z_to_point(z**(1.1+0.8*t))
|
||||||
)
|
)
|
||||||
stand_in_arrow = Arrow(
|
stand_in_arrow = Arrow(
|
||||||
arrow.points[-2], arrow.points[-1],
|
arrow.get_points()[-2], arrow.get_points()[-1],
|
||||||
tip_length = 0.2
|
tip_length = 0.2
|
||||||
)
|
)
|
||||||
arrow.add(stand_in_arrow.tip)
|
arrow.add(stand_in_arrow.tip)
|
||||||
|
@ -2044,7 +2044,7 @@ class SquiggleOnExtensions(ZetaTransformationScene):
|
||||||
sinusoidal_func,
|
sinusoidal_func,
|
||||||
]
|
]
|
||||||
for mob in self.left_plane.family_members_with_points():
|
for mob in self.left_plane.family_members_with_points():
|
||||||
if np.all(np.abs(mob.points[:,1]) < 0.1):
|
if np.all(np.abs(mob.get_points()[:,1]) < 0.1):
|
||||||
self.left_plane.remove(mob)
|
self.left_plane.remove(mob)
|
||||||
|
|
||||||
new_left_planes = [
|
new_left_planes = [
|
||||||
|
@ -2326,7 +2326,7 @@ class IntroduceAnglePreservation(VisualizingSSquared):
|
||||||
|
|
||||||
def put_angle_tex_next_to_arc(self, angle_tex, arc):
|
def put_angle_tex_next_to_arc(self, angle_tex, arc):
|
||||||
vect = arc.point_from_proportion(0.5)-interpolate(
|
vect = arc.point_from_proportion(0.5)-interpolate(
|
||||||
arc.points[0], arc.points[-1], 0.5
|
arc.get_points()[0], arc.get_points()[-1], 0.5
|
||||||
)
|
)
|
||||||
unit_vect = vect/get_norm(vect)
|
unit_vect = vect/get_norm(vect)
|
||||||
angle_tex.move_to(arc.get_center() + 1.7*unit_vect)
|
angle_tex.move_to(arc.get_center() + 1.7*unit_vect)
|
||||||
|
|
|
@ -2345,7 +2345,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction):
|
||||||
)
|
)
|
||||||
|
|
||||||
def center_of_mass(mob):
|
def center_of_mass(mob):
|
||||||
return np.apply_along_axis(np.mean, 0, mob.points)
|
return np.apply_along_axis(np.mean, 0, mob.get_points())
|
||||||
|
|
||||||
movers = [A_group, B_group, C_group]
|
movers = [A_group, B_group, C_group]
|
||||||
A_ref, B_ref, C_ref = [g[4] for g in movers]
|
A_ref, B_ref, C_ref = [g[4] for g in movers]
|
||||||
|
|
|
@ -836,7 +836,7 @@ class WalkEquatorPostTransform(GraphScene):
|
||||||
target_dots.append(new_dots)
|
target_dots.append(new_dots)
|
||||||
|
|
||||||
alt_eq = equator.copy()
|
alt_eq = equator.copy()
|
||||||
alt_eq.points = np.array(list(reversed(alt_eq.points)))
|
alt_eq.set_points(list(reversed(alt_eq.get_points())))
|
||||||
alt_dots = dots.copy()
|
alt_dots = dots.copy()
|
||||||
alt_dots.submobjects.reverse()
|
alt_dots.submobjects.reverse()
|
||||||
target_arcs += [alt_eq, alt_eq.copy()]
|
target_arcs += [alt_eq, alt_eq.copy()]
|
||||||
|
|
|
@ -83,7 +83,7 @@ class TenDollarBill(VGroup):
|
||||||
oval = Circle()
|
oval = Circle()
|
||||||
oval.stretch_to_fit_height(0.7*self.height)
|
oval.stretch_to_fit_height(0.7*self.height)
|
||||||
oval.stretch_to_fit_width(0.4*self.height)
|
oval.stretch_to_fit_width(0.4*self.height)
|
||||||
rect.add_subpath(oval.points)
|
rect.add_subpath(oval.get_points())
|
||||||
|
|
||||||
pi = Randolph(
|
pi = Randolph(
|
||||||
mode = "pondering",
|
mode = "pondering",
|
||||||
|
@ -3079,9 +3079,9 @@ class IntroduceBlockChain(Scene):
|
||||||
0
|
0
|
||||||
])
|
])
|
||||||
arrow = Arrow(end+LEFT, end, buff = SMALL_BUFF)
|
arrow = Arrow(end+LEFT, end, buff = SMALL_BUFF)
|
||||||
arrow.points[0] = block.get_right()
|
arrow.get_points()[0] = block.get_right()
|
||||||
arrow.points[1] = block.get_right() + RIGHT
|
arrow.get_points()[1] = block.get_right() + RIGHT
|
||||||
arrow.points[2] = end + LEFT + SMALL_BUFF*UP
|
arrow.get_points()[2] = end + LEFT + SMALL_BUFF*UP
|
||||||
new_arrows.add(arrow)
|
new_arrows.add(arrow)
|
||||||
|
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
|
@ -3272,10 +3272,10 @@ class DistributedBlockChainScene(DistributedLedgerScene):
|
||||||
b2.get_left(), b2.get_corner(UP+LEFT), 0.8
|
b2.get_left(), b2.get_corner(UP+LEFT), 0.8
|
||||||
)
|
)
|
||||||
arrow.next_to(target_point, LEFT, 0.5*SMALL_BUFF)
|
arrow.next_to(target_point, LEFT, 0.5*SMALL_BUFF)
|
||||||
arrow.points[0] = b1.get_right()
|
arrow.get_points()[0] = b1.get_right()
|
||||||
arrow.points[1] = b2.get_left()
|
arrow.get_points()[1] = b2.get_left()
|
||||||
arrow.points[2] = b1.get_corner(UP+RIGHT)
|
arrow.get_points()[2] = b1.get_corner(UP+RIGHT)
|
||||||
arrow.points[2] += SMALL_BUFF*LEFT
|
arrow.get_points()[2] += SMALL_BUFF*LEFT
|
||||||
arrows.add(arrow)
|
arrows.add(arrow)
|
||||||
block_chain = VGroup(blocks, arrows)
|
block_chain = VGroup(blocks, arrows)
|
||||||
block_chain.blocks = blocks
|
block_chain.blocks = blocks
|
||||||
|
@ -4259,9 +4259,9 @@ class AliceRacesOtherMiners(DoubleSpendingAttack):
|
||||||
block.target.shift(dist*DOWN)
|
block.target.shift(dist*DOWN)
|
||||||
ff_head.target.shift(dist*UP)
|
ff_head.target.shift(dist*UP)
|
||||||
arrow.target[1].shift(dist*DOWN)
|
arrow.target[1].shift(dist*DOWN)
|
||||||
arrow.target.points[-2:] += dist*DOWN
|
arrow.target.get_points()[-2:] += dist*DOWN
|
||||||
ff_arrow.target[1].shift(dist*UP)
|
ff_arrow.target[1].shift(dist*UP)
|
||||||
ff_arrow.target.points[-2:] += dist*UP
|
ff_arrow.target.get_points()[-2:] += dist*UP
|
||||||
|
|
||||||
self.play(
|
self.play(
|
||||||
Broadcast(block),
|
Broadcast(block),
|
||||||
|
@ -5003,7 +5003,7 @@ class ShowManyExchanges(Scene):
|
||||||
currencies = self.get_currencies()
|
currencies = self.get_currencies()
|
||||||
for currency in it.chain(currencies, cryptocurrencies):
|
for currency in it.chain(currencies, cryptocurrencies):
|
||||||
currency.set_height(0.5)
|
currency.set_height(0.5)
|
||||||
currency.align_data(EthereumLogo())
|
currency.align_data_and_family(EthereumLogo())
|
||||||
exchange = VGroup(*[
|
exchange = VGroup(*[
|
||||||
Arrow(
|
Arrow(
|
||||||
p1, p2,
|
p1, p2,
|
||||||
|
|
|
@ -51,7 +51,7 @@ class ConfettiSpiril(Animation):
|
||||||
Animation.__init__(self, mobject, **kwargs)
|
Animation.__init__(self, mobject, **kwargs)
|
||||||
|
|
||||||
def interpolate_submobject(self, submobject, starting_submobject, alpha):
|
def interpolate_submobject(self, submobject, starting_submobject, alpha):
|
||||||
submobject.points = np.array(starting_submobject.points)
|
submobject.set_points(starting_submobject.get_points())
|
||||||
|
|
||||||
def interpolate_mobject(self, alpha):
|
def interpolate_mobject(self, alpha):
|
||||||
Animation.interpolate_mobject(self, alpha)
|
Animation.interpolate_mobject(self, alpha)
|
||||||
|
@ -400,7 +400,7 @@ class SymmetriesOfSquare(ThreeDScene):
|
||||||
for axis in OUT, RIGHT, UP:
|
for axis in OUT, RIGHT, UP:
|
||||||
self.rotate_square(
|
self.rotate_square(
|
||||||
angle = np.pi, axis = axis,
|
angle = np.pi, axis = axis,
|
||||||
added_anims = [randy.look_at, self.square.points[0]]
|
added_anims = [randy.look_at, self.square.get_points()[0]]
|
||||||
)
|
)
|
||||||
self.play(Blink(randy))
|
self.play(Blink(randy))
|
||||||
self.wait()
|
self.wait()
|
||||||
|
@ -551,7 +551,7 @@ class SymmetriesOfSquare(ThreeDScene):
|
||||||
|
|
||||||
def get_rotation_arcs(self, square, angle, angle_buff = SMALL_BUFF):
|
def get_rotation_arcs(self, square, angle, angle_buff = SMALL_BUFF):
|
||||||
square_radius = get_norm(
|
square_radius = get_norm(
|
||||||
square.points[0] - square.get_center()
|
square.get_points()[0] - square.get_center()
|
||||||
)
|
)
|
||||||
arc = Arc(
|
arc = Arc(
|
||||||
radius = square_radius + SMALL_BUFF,
|
radius = square_radius + SMALL_BUFF,
|
||||||
|
|
|
@ -569,11 +569,11 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos):
|
||||||
mob.set_color(self.colors[0])
|
mob.set_color(self.colors[0])
|
||||||
|
|
||||||
def update_dot(dot):
|
def update_dot(dot):
|
||||||
dot.move_to(cosine_graph.points[-1])
|
dot.move_to(cosine_graph.get_points()[-1])
|
||||||
return dot
|
return dot
|
||||||
|
|
||||||
self.play(Write(cosine_label, run_time = 1))
|
self.play(Write(cosine_label, run_time = 1))
|
||||||
self.play(dot.move_to, cosine_graph.points[0])
|
self.play(dot.move_to, cosine_graph.get_points()[0])
|
||||||
self.play(
|
self.play(
|
||||||
ShowCreation(cosine_graph),
|
ShowCreation(cosine_graph),
|
||||||
UpdateFromFunc(dot, update_dot),
|
UpdateFromFunc(dot, update_dot),
|
||||||
|
|
|
@ -107,7 +107,7 @@ class ContrastAbstractAndConcrete(Scene):
|
||||||
spring.next_to(ORIGIN, RIGHT)
|
spring.next_to(ORIGIN, RIGHT)
|
||||||
spring.shift(
|
spring.shift(
|
||||||
alignement_mob.get_center()[1]*UP + SMALL_BUFF*RIGHT \
|
alignement_mob.get_center()[1]*UP + SMALL_BUFF*RIGHT \
|
||||||
-spring.points[0]
|
-spring.get_points()[0]
|
||||||
)
|
)
|
||||||
weight = Square(
|
weight = Square(
|
||||||
side_length = 0.5,
|
side_length = 0.5,
|
||||||
|
@ -115,7 +115,7 @@ class ContrastAbstractAndConcrete(Scene):
|
||||||
fill_color = GREY_B,
|
fill_color = GREY_B,
|
||||||
fill_opacity = 1,
|
fill_opacity = 1,
|
||||||
)
|
)
|
||||||
weight.move_to(spring.points[-1])
|
weight.move_to(spring.get_points()[-1])
|
||||||
spring.add(weight)
|
spring.add(weight)
|
||||||
|
|
||||||
return Transform(
|
return Transform(
|
||||||
|
@ -1716,7 +1716,7 @@ class OneOverX(PiCreatureScene, GraphScene):
|
||||||
def introduce_graph(self):
|
def introduce_graph(self):
|
||||||
rect_group = self.rect_group
|
rect_group = self.rect_group
|
||||||
graph = self.get_graph(lambda x : 1./x)
|
graph = self.get_graph(lambda x : 1./x)
|
||||||
graph.points = np.array(list(reversed(graph.points)))
|
graph.set_points(list(reversed(graph.get_points())))
|
||||||
|
|
||||||
self.change_rectangle_group(
|
self.change_rectangle_group(
|
||||||
rect_group, 0.01,
|
rect_group, 0.01,
|
||||||
|
@ -2587,7 +2587,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene):
|
||||||
little_triangle.get_width()/big_triangle.get_height()
|
little_triangle.get_width()/big_triangle.get_height()
|
||||||
)
|
)
|
||||||
new_angle_label.rotate(-np.pi/2)
|
new_angle_label.rotate(-np.pi/2)
|
||||||
new_angle_label.shift(little_triangle.points[0])
|
new_angle_label.shift(little_triangle.get_points()[0])
|
||||||
new_angle_label[1].rotate(np.pi/2)
|
new_angle_label[1].rotate(np.pi/2)
|
||||||
|
|
||||||
little_triangle_lines = VGroup(*[
|
little_triangle_lines = VGroup(*[
|
||||||
|
|
|
@ -216,7 +216,7 @@ class DampenedSpring(Scene):
|
||||||
spring.scale(0.5)
|
spring.scale(0.5)
|
||||||
spring.rotate(np.pi/6, UP)
|
spring.rotate(np.pi/6, UP)
|
||||||
spring.set_color(GREY)
|
spring.set_color(GREY)
|
||||||
spring.shift(-spring.points[0] + 3*LEFT)
|
spring.shift(-spring.get_points()[0] + 3*LEFT)
|
||||||
|
|
||||||
moving_spring = compact_spring.copy()
|
moving_spring = compact_spring.copy()
|
||||||
|
|
||||||
|
|
|
@ -604,10 +604,10 @@ class FakeDiagram(TeacherStudentsScene):
|
||||||
for dx in (0.25, 0)
|
for dx in (0.25, 0)
|
||||||
])
|
])
|
||||||
for graph in graphs:
|
for graph in graphs:
|
||||||
end_point = graph.points[-1]
|
end_point = graph.get_points()[-1]
|
||||||
axis_point = end_point[0]*RIGHT + gs.graph_origin[1]*UP
|
axis_point = end_point[0]*RIGHT + gs.graph_origin[1]*UP
|
||||||
for alpha in np.linspace(0, 1, 20):
|
for alpha in np.linspace(0, 1, 20):
|
||||||
point = interpolate(axis_point, graph.points[0], alpha)
|
point = interpolate(axis_point, graph.get_points()[0], alpha)
|
||||||
graph.add_line_to(point)
|
graph.add_line_to(point)
|
||||||
graph.set_stroke(width = 1)
|
graph.set_stroke(width = 1)
|
||||||
graph.set_fill(opacity = 1)
|
graph.set_fill(opacity = 1)
|
||||||
|
@ -1686,8 +1686,8 @@ class TemperatureOverTimeOfWarmWater(GraphScene):
|
||||||
def update_delta_T_group(group):
|
def update_delta_T_group(group):
|
||||||
brace, label = group
|
brace, label = group
|
||||||
v_line = Line(
|
v_line = Line(
|
||||||
graph.points[-1],
|
graph.get_points()[-1],
|
||||||
graph.points[-1][0]*RIGHT + h_line.get_center()[1]*UP
|
graph.get_points()[-1][0]*RIGHT + h_line.get_center()[1]*UP
|
||||||
)
|
)
|
||||||
brace.set_height(v_line.get_height())
|
brace.set_height(v_line.get_height())
|
||||||
brace.next_to(v_line, RIGHT, SMALL_BUFF)
|
brace.next_to(v_line, RIGHT, SMALL_BUFF)
|
||||||
|
|
|
@ -516,7 +516,7 @@ class AreaUnderVGraph(PlotVelocity):
|
||||||
|
|
||||||
for new_rects in rect_list:
|
for new_rects in rect_list:
|
||||||
new_rects.set_fill(opacity = 0.8)
|
new_rects.set_fill(opacity = 0.8)
|
||||||
rects.align_submobjects(new_rects)
|
rects.align_family(new_rects)
|
||||||
for alt_rect in rects[::2]:
|
for alt_rect in rects[::2]:
|
||||||
alt_rect.set_fill(opacity = 0)
|
alt_rect.set_fill(opacity = 0)
|
||||||
self.play(Transform(
|
self.play(Transform(
|
||||||
|
@ -1191,7 +1191,7 @@ class PiecewiseConstantPlot(PlotVelocity):
|
||||||
dt_copy, self.v_t, self.v_t_brace
|
dt_copy, self.v_t, self.v_t_brace
|
||||||
]))
|
]))
|
||||||
)
|
)
|
||||||
rects.align_submobjects(next_rects)
|
rects.align_family(next_rects)
|
||||||
for every_other_rect in rects[::2]:
|
for every_other_rect in rects[::2]:
|
||||||
every_other_rect.set_fill(opacity = 0)
|
every_other_rect.set_fill(opacity = 0)
|
||||||
self.play(
|
self.play(
|
||||||
|
@ -1269,7 +1269,7 @@ class PiecewiseConstantPlot(PlotVelocity):
|
||||||
)
|
)
|
||||||
self.play(FadeIn(brace), FadeIn(dt_to_0))
|
self.play(FadeIn(brace), FadeIn(dt_to_0))
|
||||||
for new_rects in self.rect_list[4:]:
|
for new_rects in self.rect_list[4:]:
|
||||||
rects.align_submobjects(new_rects)
|
rects.align_family(new_rects)
|
||||||
for every_other_rect in rects[::2]:
|
for every_other_rect in rects[::2]:
|
||||||
every_other_rect.set_fill(opacity = 0)
|
every_other_rect.set_fill(opacity = 0)
|
||||||
self.play(
|
self.play(
|
||||||
|
@ -1455,7 +1455,7 @@ class AreaUnderACurve(GraphScene):
|
||||||
self.play(ShowCreation(graph))
|
self.play(ShowCreation(graph))
|
||||||
self.play(Write(rects))
|
self.play(Write(rects))
|
||||||
for new_rects in rect_list[1:]:
|
for new_rects in rect_list[1:]:
|
||||||
rects.align_submobjects(new_rects)
|
rects.align_family(new_rects)
|
||||||
for every_other_rect in rects[::2]:
|
for every_other_rect in rects[::2]:
|
||||||
every_other_rect.set_fill(opacity = 0)
|
every_other_rect.set_fill(opacity = 0)
|
||||||
self.play(Transform(
|
self.play(Transform(
|
||||||
|
@ -1993,7 +1993,7 @@ class GraphSPlusC(GraphDistanceVsTime):
|
||||||
"s(t) = 4t^2 - \\frac{1}{3}t^3", "+C"
|
"s(t) = 4t^2 - \\frac{1}{3}t^3", "+C"
|
||||||
)
|
)
|
||||||
plus_C.set_color(YELLOW)
|
plus_C.set_color(YELLOW)
|
||||||
full_label.next_to(graph.points[-1], DOWN)
|
full_label.next_to(graph.get_points()[-1], DOWN)
|
||||||
full_label.to_edge(RIGHT)
|
full_label.to_edge(RIGHT)
|
||||||
|
|
||||||
self.play(ShowCreation(graph))
|
self.play(ShowCreation(graph))
|
||||||
|
|
|
@ -192,7 +192,7 @@ class SecondDerivativeGraphically(GraphScene):
|
||||||
dot = Dot()
|
dot = Dot()
|
||||||
def get_dot_update_func(curve):
|
def get_dot_update_func(curve):
|
||||||
def update_dot(dot):
|
def update_dot(dot):
|
||||||
dot.move_to(curve.points[-1])
|
dot.move_to(curve.get_points()[-1])
|
||||||
return dot
|
return dot
|
||||||
return update_dot
|
return update_dot
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Britain(SVGMobject):
|
||||||
}
|
}
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
SVGMobject.__init__(self, **kwargs)
|
SVGMobject.__init__(self, **kwargs)
|
||||||
self.points = self[0].points
|
self.set_points(self[0].get_points())
|
||||||
self.submobjects = []
|
self.submobjects = []
|
||||||
self.set_height(self.height)
|
self.set_height(self.height)
|
||||||
self.center()
|
self.center()
|
||||||
|
@ -420,7 +420,7 @@ class InfiniteKochZoom(Scene):
|
||||||
def construct(self):
|
def construct(self):
|
||||||
small_curve = self.get_curve(self.order)
|
small_curve = self.get_curve(self.order)
|
||||||
larger_curve = self.get_curve(self.order + 1)
|
larger_curve = self.get_curve(self.order + 1)
|
||||||
larger_curve.scale(3, about_point = small_curve.points[0])
|
larger_curve.scale(3, about_point = small_curve.get_points()[0])
|
||||||
self.play(Transform(small_curve, larger_curve, run_time = 2))
|
self.play(Transform(small_curve, larger_curve, run_time = 2))
|
||||||
self.repeat_frames(5)
|
self.repeat_frames(5)
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@ class InfiniteKochZoom(Scene):
|
||||||
)
|
)
|
||||||
koch_curve.set_width(18)
|
koch_curve.set_width(18)
|
||||||
koch_curve.shift(
|
koch_curve.shift(
|
||||||
self.left_point - koch_curve.points[0]
|
self.left_point - koch_curve.get_points()[0]
|
||||||
)
|
)
|
||||||
return koch_curve
|
return koch_curve
|
||||||
|
|
||||||
|
|
|
@ -3175,8 +3175,8 @@ class ProportionOfSphereInBox(GraphScene):
|
||||||
|
|
||||||
graph = self.get_graph(lambda x : np.exp(0.1*(9-x)))
|
graph = self.get_graph(lambda x : np.exp(0.1*(9-x)))
|
||||||
max_y = self.coords_to_point(0, 1)[1]
|
max_y = self.coords_to_point(0, 1)[1]
|
||||||
too_high = graph.points[:,1] > max_y
|
too_high = graph.get_points()[:,1] > max_y
|
||||||
graph.points[too_high, 1] = max_y
|
graph.get_points()[too_high, 1] = max_y
|
||||||
|
|
||||||
footnote = TextMobject("""
|
footnote = TextMobject("""
|
||||||
\\begin{flushleft}
|
\\begin{flushleft}
|
||||||
|
|
|
@ -42,7 +42,7 @@ class HappyHolidays(TeacherStudentsScene):
|
||||||
vect = LEFT
|
vect = LEFT
|
||||||
hat.set_fill(RED_D)
|
hat.set_fill(RED_D)
|
||||||
hat.set_stroke(width=0)
|
hat.set_stroke(width=0)
|
||||||
hat[0].points = hat[0].points[8 * 4:]
|
hat[0].set_points(hat[0].get_points()[8 * 4:])
|
||||||
hat[0].set_fill("#DDDDDD")
|
hat[0].set_fill("#DDDDDD")
|
||||||
hat[2].set_fill(WHITE)
|
hat[2].set_fill(WHITE)
|
||||||
hat.add(hat[0])
|
hat.add(hat[0])
|
||||||
|
@ -188,7 +188,7 @@ class UtilitiesPuzzleScene(Scene):
|
||||||
for i, edge in enumerate(bounding_edges):
|
for i, edge in enumerate(bounding_edges):
|
||||||
new_edge = edge.copy()
|
new_edge = edge.copy()
|
||||||
if i%2 == 1:
|
if i%2 == 1:
|
||||||
new_edge.points = new_edge.points[::-1]
|
new_edge.set_points(new_edge.get_points()[::-1])
|
||||||
region.append_vectorized_mobject(new_edge)
|
region.append_vectorized_mobject(new_edge)
|
||||||
region.set_stroke(width = 0)
|
region.set_stroke(width = 0)
|
||||||
region.set_fill(WHITE, opacity = 1)
|
region.set_fill(WHITE, opacity = 1)
|
||||||
|
@ -977,7 +977,7 @@ class NewRegionClosedOnlyForNodesWithEdges(UtilitiesPuzzleScene):
|
||||||
self.get_line(2, 2),
|
self.get_line(2, 2),
|
||||||
)
|
)
|
||||||
lit_line = lines[2].copy()
|
lit_line = lines[2].copy()
|
||||||
lit_line.points = lit_line.points[::-1]
|
lit_line.set_points(lit_line.get_points()[::-1])
|
||||||
lit_line.set_stroke(WHITE, 5)
|
lit_line.set_stroke(WHITE, 5)
|
||||||
|
|
||||||
region = self.get_region(*lines)
|
region = self.get_region(*lines)
|
||||||
|
@ -1438,7 +1438,7 @@ class CyclesHaveAtLeastFour(UtilitiesPuzzleScene):
|
||||||
self.get_line(1, 0, self.objects.get_corner(DOWN+LEFT)),
|
self.get_line(1, 0, self.objects.get_corner(DOWN+LEFT)),
|
||||||
]
|
]
|
||||||
for line in lines[1::2]:
|
for line in lines[1::2]:
|
||||||
line.points = line.points[::-1]
|
line.set_points(line.get_points()[::-1])
|
||||||
arrows = VGroup()
|
arrows = VGroup()
|
||||||
for vertex in vertices:
|
for vertex in vertices:
|
||||||
vect = vertices.get_center() - vertex.get_center()
|
vect = vertices.get_center() - vertex.get_center()
|
||||||
|
|
|
@ -2170,7 +2170,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene):
|
||||||
new_decimal.set_depth(decimal.get_depth())
|
new_decimal.set_depth(decimal.get_depth())
|
||||||
new_decimal.move_to(decimal, UP)
|
new_decimal.move_to(decimal, UP)
|
||||||
new_decimal.set_color(decimal.get_color())
|
new_decimal.set_color(decimal.get_color())
|
||||||
decimal.align_data(new_decimal)
|
decimal.align_data_and_family(new_decimal)
|
||||||
families = [
|
families = [
|
||||||
mob.family_members_with_points()
|
mob.family_members_with_points()
|
||||||
for mob in (decimal, new_decimal)
|
for mob in (decimal, new_decimal)
|
||||||
|
@ -4052,7 +4052,7 @@ class CircularPhotons(ShootPhotonThroughFilter):
|
||||||
arrows.scale(0.7)
|
arrows.scale(0.7)
|
||||||
arrows.rotate(np.pi/2, RIGHT)
|
arrows.rotate(np.pi/2, RIGHT)
|
||||||
arrows.rotate(np.pi/2, OUT)
|
arrows.rotate(np.pi/2, OUT)
|
||||||
arrows.move_to(center_of_mass(pf.points))
|
arrows.move_to(center_of_mass(pf.get_points()))
|
||||||
|
|
||||||
pf.label = arrows
|
pf.label = arrows
|
||||||
pf.add(arrows)
|
pf.add(arrows)
|
||||||
|
|
|
@ -552,7 +552,7 @@ class WalkerAnimation(Animation):
|
||||||
|
|
||||||
# Perhaps abstract this out into an "Animation updating from original object" class
|
# Perhaps abstract this out into an "Animation updating from original object" class
|
||||||
def interpolate_submobject(self, submobject, starting_submobject, alpha):
|
def interpolate_submobject(self, submobject, starting_submobject, alpha):
|
||||||
submobject.points = np.array(starting_submobject.points)
|
submobject.set_points(starting_submobject.get_points())
|
||||||
|
|
||||||
def interpolate_mobject(self, alpha):
|
def interpolate_mobject(self, alpha):
|
||||||
Animation.interpolate_mobject(self, alpha)
|
Animation.interpolate_mobject(self, alpha)
|
||||||
|
@ -1328,7 +1328,7 @@ class FuncRotater(Animation):
|
||||||
|
|
||||||
# Perhaps abstract this out into an "Animation updating from original object" class
|
# Perhaps abstract this out into an "Animation updating from original object" class
|
||||||
def interpolate_submobject(self, submobject, starting_submobject, alpha):
|
def interpolate_submobject(self, submobject, starting_submobject, alpha):
|
||||||
submobject.points = np.array(starting_submobject.points)
|
submobject.set_points(starting_submobject.get_points())
|
||||||
|
|
||||||
def interpolate_mobject(self, alpha):
|
def interpolate_mobject(self, alpha):
|
||||||
Animation.interpolate_mobject(self, alpha)
|
Animation.interpolate_mobject(self, alpha)
|
||||||
|
@ -1632,12 +1632,12 @@ class HasItsLimitations(Scene):
|
||||||
new_curved_arrow.init_points()
|
new_curved_arrow.init_points()
|
||||||
new_curved_arrow.add_tip()
|
new_curved_arrow.add_tip()
|
||||||
|
|
||||||
input_diff = input_dot.get_center() - curved_arrow.points[0]
|
input_diff = input_dot.get_center() - curved_arrow.get_points()[0]
|
||||||
output_diff = output_dot.get_center() - curved_arrow.points[-1]
|
output_diff = output_dot.get_center() - curved_arrow.get_points()[-1]
|
||||||
|
|
||||||
new_curved_arrow.shift((new_input_dot.get_center() - new_curved_arrow.points[0]) - input_diff)
|
new_curved_arrow.shift((new_input_dot.get_center() - new_curved_arrow.get_points()[0]) - input_diff)
|
||||||
|
|
||||||
new_output_dot = output_dot.copy().move_to(new_curved_arrow.points[-1] + output_diff)
|
new_output_dot = output_dot.copy().move_to(new_curved_arrow.get_points()[-1] + output_diff)
|
||||||
new_output_label = output_label.copy().next_to(new_output_dot, UP + RIGHT)
|
new_output_label = output_label.copy().next_to(new_output_dot, UP + RIGHT)
|
||||||
|
|
||||||
dot_objects = Group(input_dot, input_label, output_dot, output_label, curved_arrow)
|
dot_objects = Group(input_dot, input_label, output_dot, output_label, curved_arrow)
|
||||||
|
|
|
@ -1615,13 +1615,13 @@ class DirectionOfA2DFunctionAlongABoundary(InputOutputScene):
|
||||||
rect_image = rect.copy()
|
rect_image = rect.copy()
|
||||||
rect_image.match_background_image_file(colorings[1])
|
rect_image.match_background_image_file(colorings[1])
|
||||||
def update_rect_image(rect_image):
|
def update_rect_image(rect_image):
|
||||||
rect_image.points = np.array(rect.points)
|
rect_image.set_points(rect.get_points())
|
||||||
rect_image.apply_function(self.point_function)
|
rect_image.apply_function(self.point_function)
|
||||||
rect_image_update_anim = UpdateFromFunc(rect_image, update_rect_image)
|
rect_image_update_anim = UpdateFromFunc(rect_image, update_rect_image)
|
||||||
|
|
||||||
|
|
||||||
def get_input_point():
|
def get_input_point():
|
||||||
return rect.points[-1]
|
return rect.get_points()[-1]
|
||||||
|
|
||||||
def get_output_coords():
|
def get_output_coords():
|
||||||
in_coords = input_plane.point_to_coords(get_input_point())
|
in_coords = input_plane.point_to_coords(get_input_point())
|
||||||
|
@ -1639,7 +1639,7 @@ class DirectionOfA2DFunctionAlongABoundary(InputOutputScene):
|
||||||
out_vect,
|
out_vect,
|
||||||
lambda ov : ov.put_start_and_end_on(
|
lambda ov : ov.put_start_and_end_on(
|
||||||
output_plane.coords_to_point(0, 0),
|
output_plane.coords_to_point(0, 0),
|
||||||
rect_image.points[-1]
|
rect_image.get_points()[-1]
|
||||||
).set_color(get_color())
|
).set_color(get_color())
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1833,7 +1833,7 @@ class ForeverNarrowingLoop(InputOutputScene):
|
||||||
circle_image.match_background_image_file(output_coloring)
|
circle_image.match_background_image_file(output_coloring)
|
||||||
|
|
||||||
def update_circle_image(circle_image):
|
def update_circle_image(circle_image):
|
||||||
circle_image.points = circle.points
|
circle_image.set_points(circle.get_points())
|
||||||
circle_image.apply_function(self.point_function)
|
circle_image.apply_function(self.point_function)
|
||||||
circle_image.make_smooth()
|
circle_image.make_smooth()
|
||||||
|
|
||||||
|
@ -2234,7 +2234,7 @@ class TransitionFromPathsToBoundaries(ColorMappedObjectsScene):
|
||||||
dot.move_to, path1.get_start()
|
dot.move_to, path1.get_start()
|
||||||
)
|
)
|
||||||
for square in squares:
|
for square in squares:
|
||||||
self.position_dot(square.points[0])
|
self.position_dot(square.get_points()[0])
|
||||||
kwargs = {
|
kwargs = {
|
||||||
"run_time" : 4,
|
"run_time" : 4,
|
||||||
"rate_func" : bezier([0, 0, 1, 1]),
|
"rate_func" : bezier([0, 0, 1, 1]),
|
||||||
|
@ -2246,11 +2246,11 @@ class TransitionFromPathsToBoundaries(ColorMappedObjectsScene):
|
||||||
)
|
)
|
||||||
self.wait()
|
self.wait()
|
||||||
self.play(
|
self.play(
|
||||||
dot.move_to, joint_rect.points[0],
|
dot.move_to, joint_rect.get_points()[0],
|
||||||
FadeOut(squares),
|
FadeOut(squares),
|
||||||
FadeIn(joint_rect),
|
FadeIn(joint_rect),
|
||||||
)
|
)
|
||||||
self.position_dot(joint_rect.points[0])
|
self.position_dot(joint_rect.get_points()[0])
|
||||||
self.play(
|
self.play(
|
||||||
Transform(left_square.label[0], joint_rect.label[0]),
|
Transform(left_square.label[0], joint_rect.label[0]),
|
||||||
Transform(
|
Transform(
|
||||||
|
@ -2378,7 +2378,7 @@ class BreakDownLoopWithNonzeroWinding(TransitionFromPathsToBoundaries):
|
||||||
for var in (x, y)
|
for var in (x, y)
|
||||||
])
|
])
|
||||||
|
|
||||||
self.position_dot(joint_rect.points[0])
|
self.position_dot(joint_rect.get_points()[0])
|
||||||
self.add(joint_rect)
|
self.add(joint_rect)
|
||||||
self.play(
|
self.play(
|
||||||
MoveAlongPath(dot, joint_rect, rate_func = bezier([0, 0, 1, 1])),
|
MoveAlongPath(dot, joint_rect, rate_func = bezier([0, 0, 1, 1])),
|
||||||
|
@ -2492,8 +2492,8 @@ class MonomialTerm(PathContainingZero):
|
||||||
out_loop.apply_function(self.point_function)
|
out_loop.apply_function(self.point_function)
|
||||||
out_loop.match_background_image_file(self.output_coloring)
|
out_loop.match_background_image_file(self.output_coloring)
|
||||||
|
|
||||||
get_in_point = lambda : loop.points[-1]
|
get_in_point = lambda : loop.get_points()[-1]
|
||||||
get_out_point = lambda : out_loop.points[-1]
|
get_out_point = lambda : out_loop.get_points()[-1]
|
||||||
in_origin = self.input_plane.coords_to_point(0, 0)
|
in_origin = self.input_plane.coords_to_point(0, 0)
|
||||||
out_origin = self.output_plane.coords_to_point(0, 0)
|
out_origin = self.output_plane.coords_to_point(0, 0)
|
||||||
|
|
||||||
|
@ -2589,7 +2589,7 @@ class PolynomialTerms(MonomialTerm):
|
||||||
out_line = line.copy()
|
out_line = line.copy()
|
||||||
update_out_line = UpdateFromFunc(
|
update_out_line = UpdateFromFunc(
|
||||||
out_line,
|
out_line,
|
||||||
lambda m : m.set_points(line.points).apply_function(self.point_function),
|
lambda m : m.set_points(line.get_points()).apply_function(self.point_function),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.play(
|
self.play(
|
||||||
|
@ -2610,7 +2610,7 @@ class PolynomialTerms(MonomialTerm):
|
||||||
|
|
||||||
update_out_loop = UpdateFromFunc(
|
update_out_loop = UpdateFromFunc(
|
||||||
out_loop,
|
out_loop,
|
||||||
lambda m : m.set_points(loop.points).apply_function(self.point_function)
|
lambda m : m.set_points(loop.get_points()).apply_function(self.point_function)
|
||||||
)
|
)
|
||||||
|
|
||||||
self.add(
|
self.add(
|
||||||
|
@ -2799,7 +2799,7 @@ class WindingNumbersInInputOutputContext(PathContainingZero):
|
||||||
out_loop.match_background_image_file(self.output_coloring)
|
out_loop.match_background_image_file(self.output_coloring)
|
||||||
update_out_loop = Mobject.add_updater(
|
update_out_loop = Mobject.add_updater(
|
||||||
out_loop,
|
out_loop,
|
||||||
lambda m : m.set_points(in_loop.points).apply_function(self.point_function)
|
lambda m : m.set_points(in_loop.get_points()).apply_function(self.point_function)
|
||||||
)
|
)
|
||||||
# self.add(update_out_loop)
|
# self.add(update_out_loop)
|
||||||
|
|
||||||
|
|
|
@ -713,7 +713,7 @@ class StartingCalc101(PiCreatureScene):
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
weight.add_updater(
|
weight.add_updater(
|
||||||
lambda w: w.move_to(spring.points[-1])
|
lambda w: w.move_to(spring.get_points()[-1])
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ class AngleUpdater(ContinualAnimation):
|
||||||
)
|
)
|
||||||
new_arc.init_points()
|
new_arc.init_points()
|
||||||
new_arc.move_arc_center_to(self.spotlight.get_source_point())
|
new_arc.move_arc_center_to(self.spotlight.get_source_point())
|
||||||
self.angle_arc.points = new_arc.points
|
self.angle_arc.set_points(new_arc.get_points())
|
||||||
self.angle_arc.add_tip(tip_length = ARC_TIP_LENGTH,
|
self.angle_arc.add_tip(tip_length = ARC_TIP_LENGTH,
|
||||||
at_start = True, at_end = True)
|
at_start = True, at_end = True)
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ class AngleUpdater(ContinualAnimation):
|
||||||
)
|
)
|
||||||
new_arc.init_points()
|
new_arc.init_points()
|
||||||
new_arc.move_arc_center_to(self.spotlight.get_source_point())
|
new_arc.move_arc_center_to(self.spotlight.get_source_point())
|
||||||
self.angle_arc.points = new_arc.points
|
self.angle_arc.set_points(new_arc.get_points())
|
||||||
self.angle_arc.add_tip(
|
self.angle_arc.add_tip(
|
||||||
tip_length = ARC_TIP_LENGTH,
|
tip_length = ARC_TIP_LENGTH,
|
||||||
at_start = True, at_end = True
|
at_start = True, at_end = True
|
||||||
|
@ -739,7 +739,7 @@ class MathematicalWebOfConnections(PiCreatureScene):
|
||||||
|
|
||||||
def draw_circle(self):
|
def draw_circle(self):
|
||||||
semi_circle = Arc(angle = np.pi, radius = 2)
|
semi_circle = Arc(angle = np.pi, radius = 2)
|
||||||
radius = Line(ORIGIN, semi_circle.points[0])
|
radius = Line(ORIGIN, semi_circle.get_points()[0])
|
||||||
radius.set_color(BLUE)
|
radius.set_color(BLUE)
|
||||||
semi_circle.set_color(YELLOW)
|
semi_circle.set_color(YELLOW)
|
||||||
|
|
||||||
|
@ -749,7 +749,7 @@ class MathematicalWebOfConnections(PiCreatureScene):
|
||||||
|
|
||||||
decimal = DecimalNumber(0)
|
decimal = DecimalNumber(0)
|
||||||
def decimal_position_update_func(decimal):
|
def decimal_position_update_func(decimal):
|
||||||
decimal.move_to(semi_circle.points[-1])
|
decimal.move_to(semi_circle.get_points()[-1])
|
||||||
decimal.shift(0.3*radius.get_vector())
|
decimal.shift(0.3*radius.get_vector())
|
||||||
|
|
||||||
one = TexMobject("1")
|
one = TexMobject("1")
|
||||||
|
@ -1386,11 +1386,11 @@ class IntroduceScreen(Scene):
|
||||||
rays.set_stroke(YELLOW, 1)
|
rays.set_stroke(YELLOW, 1)
|
||||||
max_angle = np.max([
|
max_angle = np.max([
|
||||||
angle_of_vector(point - source_point)
|
angle_of_vector(point - source_point)
|
||||||
for point in screen.points
|
for point in screen.get_points()
|
||||||
])
|
])
|
||||||
min_angle = np.min([
|
min_angle = np.min([
|
||||||
angle_of_vector(point - source_point)
|
angle_of_vector(point - source_point)
|
||||||
for point in screen.points
|
for point in screen.get_points()
|
||||||
])
|
])
|
||||||
for ray in rays:
|
for ray in rays:
|
||||||
if min_angle <= ray.get_angle() <= max_angle:
|
if min_angle <= ray.get_angle() <= max_angle:
|
||||||
|
@ -2685,7 +2685,7 @@ class IPTScene(TwoLightSourcesScene, ZoomedScene):
|
||||||
anims = []
|
anims = []
|
||||||
if x > 0:
|
if x > 0:
|
||||||
anims.append(FadeOut(triangle.copy()))
|
anims.append(FadeOut(triangle.copy()))
|
||||||
anims.append(GrowFromPoint(triangle, triangle.points[0]))
|
anims.append(GrowFromPoint(triangle, triangle.get_points()[0]))
|
||||||
self.play(*anims)
|
self.play(*anims)
|
||||||
self.play(FadeOut(triangle))
|
self.play(FadeOut(triangle))
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -237,7 +237,7 @@ class MathIsDeep(PiCreatureScene):
|
||||||
# pn.fade(1)
|
# pn.fade(1)
|
||||||
# pn.set_color(RED)
|
# pn.set_color(RED)
|
||||||
# pn.move_to(letter)
|
# pn.move_to(letter)
|
||||||
# num_mobs[1].add_subpath(num_mobs[1].points)
|
# num_mobs[1].add_subpath(num_mobs[1].get_points())
|
||||||
|
|
||||||
self.play(
|
self.play(
|
||||||
LaggedStartMap(
|
LaggedStartMap(
|
||||||
|
|
|
@ -282,8 +282,8 @@ class ShowWritingTrajectory(TeacherStudentsScene):
|
||||||
for x in np.arange(0, 1 + step, step)
|
for x in np.arange(0, 1 + step, step)
|
||||||
])
|
])
|
||||||
arrow = Arrow(
|
arrow = Arrow(
|
||||||
solid_path.points[-2],
|
solid_path.get_points()[-2],
|
||||||
solid_path.points[-1],
|
solid_path.get_points()[-1],
|
||||||
buff=0
|
buff=0
|
||||||
)
|
)
|
||||||
dashed_path.add(arrow.tip)
|
dashed_path.add(arrow.tip)
|
||||||
|
@ -1409,8 +1409,8 @@ class FluidFlowAsHillGradient(CylinderModel, ThreeDScene):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
for line in stream_lines:
|
for line in stream_lines:
|
||||||
line.points[:, 2] = np.apply_along_axis(
|
line.get_points()[:, 2] = np.apply_along_axis(
|
||||||
potential, 1, line.points
|
potential, 1, line.get_points()
|
||||||
)
|
)
|
||||||
stream_lines_animation = self.get_stream_lines_animation(
|
stream_lines_animation = self.get_stream_lines_animation(
|
||||||
stream_lines
|
stream_lines
|
||||||
|
@ -2005,7 +2005,7 @@ class PureCylinderFlow(Scene):
|
||||||
)
|
)
|
||||||
self.add(stream_lines)
|
self.add(stream_lines)
|
||||||
for stream_line in stream_lines:
|
for stream_line in stream_lines:
|
||||||
if get_norm(stream_line.points[0]) < 1:
|
if get_norm(stream_line.get_points()[0]) < 1:
|
||||||
stream_lines.remove(stream_line)
|
stream_lines.remove(stream_line)
|
||||||
|
|
||||||
self.modify_flow(stream_lines)
|
self.modify_flow(stream_lines)
|
||||||
|
@ -4123,7 +4123,7 @@ class NoChargesOverlay(Scene):
|
||||||
rect.set_fill(BLUE_D, 0.75)
|
rect.set_fill(BLUE_D, 0.75)
|
||||||
circle = Circle(radius=1.5, num_anchors=5000)
|
circle = Circle(radius=1.5, num_anchors=5000)
|
||||||
circle.rotate(135 * DEGREES)
|
circle.rotate(135 * DEGREES)
|
||||||
rect.add_subpath(circle.points)
|
rect.add_subpath(circle.get_points())
|
||||||
|
|
||||||
words = TextMobject("No charges outside wire")
|
words = TextMobject("No charges outside wire")
|
||||||
words.scale(1.5)
|
words.scale(1.5)
|
||||||
|
|
|
@ -2339,7 +2339,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene):
|
||||||
odm_words_outline = VGroup()
|
odm_words_outline = VGroup()
|
||||||
for letter in odm_words:
|
for letter in odm_words:
|
||||||
mob = VMobject()
|
mob = VMobject()
|
||||||
mob.points = letter.points
|
mob.set_points(letter.get_points())
|
||||||
odm_words_outline.add(mob)
|
odm_words_outline.add(mob)
|
||||||
odm_words_outline.set_fill(opacity = 0)
|
odm_words_outline.set_fill(opacity = 0)
|
||||||
odm_words_outline.set_stroke(YELLOW, 1)
|
odm_words_outline.set_stroke(YELLOW, 1)
|
||||||
|
|
|
@ -72,8 +72,8 @@ class FlatCoin(UprightCoin):
|
||||||
self.stretch_in_place(self.foreshortening, 1)
|
self.stretch_in_place(self.foreshortening, 1)
|
||||||
|
|
||||||
# draw the edge
|
# draw the edge
|
||||||
control_points1 = self.points[12:25].tolist()
|
control_points1 = self.get_points()[12:25].tolist()
|
||||||
control_points2 = self.copy().shift(self.thickness * DOWN).points[12:25].tolist()
|
control_points2 = self.copy().shift(self.thickness * DOWN).get_points()[12:25].tolist()
|
||||||
edge_anchors_and_handles = control_points1
|
edge_anchors_and_handles = control_points1
|
||||||
edge_anchors_and_handles.append(edge_anchors_and_handles[-1] + self.thickness * DOWN)
|
edge_anchors_and_handles.append(edge_anchors_and_handles[-1] + self.thickness * DOWN)
|
||||||
edge_anchors_and_handles.append(edge_anchors_and_handles[-1] + self.thickness * UP)
|
edge_anchors_and_handles.append(edge_anchors_and_handles[-1] + self.thickness * UP)
|
||||||
|
|
|
@ -34,7 +34,7 @@ def get_fourier_graph(
|
||||||
])
|
])
|
||||||
graph.set_color(color)
|
graph.set_color(color)
|
||||||
f_min, f_max = [
|
f_min, f_max = [
|
||||||
axes.x_axis.point_to_number(graph.points[i])
|
axes.x_axis.point_to_number(graph.get_points()[i])
|
||||||
for i in (0, -1)
|
for i in (0, -1)
|
||||||
]
|
]
|
||||||
graph.underlying_function = lambda f : axes.y_axis.point_to_number(
|
graph.underlying_function = lambda f : axes.y_axis.point_to_number(
|
||||||
|
@ -921,8 +921,8 @@ class FourierMachineScene(Scene):
|
||||||
self.get_frequency_axes()
|
self.get_frequency_axes()
|
||||||
func = time_graph.underlying_function
|
func = time_graph.underlying_function
|
||||||
t_axis = self.time_axes.x_axis
|
t_axis = self.time_axes.x_axis
|
||||||
t_min = t_axis.point_to_number(time_graph.points[0])
|
t_min = t_axis.point_to_number(time_graph.get_points()[0])
|
||||||
t_max = t_axis.point_to_number(time_graph.points[-1])
|
t_max = t_axis.point_to_number(time_graph.get_points()[-1])
|
||||||
f_max = self.frequency_axes.x_max
|
f_max = self.frequency_axes.x_max
|
||||||
# result = get_fourier_graph(
|
# result = get_fourier_graph(
|
||||||
# self.frequency_axes, func, t_min, t_max,
|
# self.frequency_axes, func, t_min, t_max,
|
||||||
|
@ -930,12 +930,12 @@ class FourierMachineScene(Scene):
|
||||||
# )
|
# )
|
||||||
# too_far_right_point_indices = [
|
# too_far_right_point_indices = [
|
||||||
# i
|
# i
|
||||||
# for i, point in enumerate(result.points)
|
# for i, point in enumerate(result.get_points())
|
||||||
# if self.frequency_axes.x_axis.point_to_number(point) > f_max
|
# if self.frequency_axes.x_axis.point_to_number(point) > f_max
|
||||||
# ]
|
# ]
|
||||||
# if too_far_right_point_indices:
|
# if too_far_right_point_indices:
|
||||||
# i = min(too_far_right_point_indices)
|
# i = min(too_far_right_point_indices)
|
||||||
# prop = float(i)/len(result.points)
|
# prop = float(i)/len(result.get_points())
|
||||||
# result.pointwise_become_partial(result, 0, prop)
|
# result.pointwise_become_partial(result, 0, prop)
|
||||||
# return result
|
# return result
|
||||||
return self.frequency_axes.get_graph(
|
return self.frequency_axes.get_graph(
|
||||||
|
@ -997,8 +997,8 @@ class FourierMachineScene(Scene):
|
||||||
vector = Vector(UP, color = WHITE)
|
vector = Vector(UP, color = WHITE)
|
||||||
graph_copy = graph.copy()
|
graph_copy = graph.copy()
|
||||||
x_axis = self.time_axes.x_axis
|
x_axis = self.time_axes.x_axis
|
||||||
x_min = x_axis.point_to_number(graph.points[0])
|
x_min = x_axis.point_to_number(graph.get_points()[0])
|
||||||
x_max = x_axis.point_to_number(graph.points[-1])
|
x_max = x_axis.point_to_number(graph.get_points()[-1])
|
||||||
def update_vector(vector, alpha):
|
def update_vector(vector, alpha):
|
||||||
x = interpolate(x_min, x_max, alpha)
|
x = interpolate(x_min, x_max, alpha)
|
||||||
vector.put_start_and_end_on(
|
vector.put_start_and_end_on(
|
||||||
|
@ -3342,7 +3342,7 @@ class ScaleUpCenterOfMass(WriteComplexExponentialExpression):
|
||||||
self.remove(graph.polarized_mobject)
|
self.remove(graph.polarized_mobject)
|
||||||
self.play(
|
self.play(
|
||||||
com_dot.move_to,
|
com_dot.move_to,
|
||||||
center_of_mass(short_graph.polarized_mobject.points),
|
center_of_mass(short_graph.polarized_mobject.get_points()),
|
||||||
com_vector_update,
|
com_vector_update,
|
||||||
time_span.restore,
|
time_span.restore,
|
||||||
ShowCreation(short_graph.polarized_mobject),
|
ShowCreation(short_graph.polarized_mobject),
|
||||||
|
@ -3391,7 +3391,7 @@ class ScaleUpCenterOfMass(WriteComplexExponentialExpression):
|
||||||
long_graph.move_to(graph, LEFT)
|
long_graph.move_to(graph, LEFT)
|
||||||
self.play(
|
self.play(
|
||||||
com_dot.move_to,
|
com_dot.move_to,
|
||||||
center_of_mass(long_graph.polarized_mobject.points),
|
center_of_mass(long_graph.polarized_mobject.get_points()),
|
||||||
com_vector_update,
|
com_vector_update,
|
||||||
time_span.stretch, 2, 0, {"about_edge" : LEFT},
|
time_span.stretch, 2, 0, {"about_edge" : LEFT},
|
||||||
*[
|
*[
|
||||||
|
@ -3442,7 +3442,7 @@ class ScaleUpCenterOfMass(WriteComplexExponentialExpression):
|
||||||
self.get_polarized_mobject(very_long_graph, freq = 2.0)
|
self.get_polarized_mobject(very_long_graph, freq = 2.0)
|
||||||
self.play(
|
self.play(
|
||||||
com_dot.move_to,
|
com_dot.move_to,
|
||||||
center_of_mass(very_long_graph.polarized_mobject.points),
|
center_of_mass(very_long_graph.polarized_mobject.get_points()),
|
||||||
com_vector_update,
|
com_vector_update,
|
||||||
ShowCreation(
|
ShowCreation(
|
||||||
very_long_graph,
|
very_long_graph,
|
||||||
|
@ -3711,7 +3711,7 @@ class SummarizeTheFullTransform(DrawFrequencyPlot):
|
||||||
imaginary_fourier_graph.set_color(BLUE)
|
imaginary_fourier_graph.set_color(BLUE)
|
||||||
imaginary_fourier_graph.shift(
|
imaginary_fourier_graph.shift(
|
||||||
frequency_axes.x_axis.get_right() - \
|
frequency_axes.x_axis.get_right() - \
|
||||||
imaginary_fourier_graph.points[-1],
|
imaginary_fourier_graph.get_points()[-1],
|
||||||
)
|
)
|
||||||
|
|
||||||
real_part = TextMobject(
|
real_part = TextMobject(
|
||||||
|
@ -3995,7 +3995,7 @@ class ShowUncertaintyPrinciple(Scene):
|
||||||
if axes == bottom_axes:
|
if axes == bottom_axes:
|
||||||
f = 1./f
|
f = 1./f
|
||||||
new_graph = axes.get_graph(get_bell_func(f))
|
new_graph = axes.get_graph(get_bell_func(f))
|
||||||
graph.points = new_graph.points
|
graph.set_points(new_graph.get_points())
|
||||||
return update_graph
|
return update_graph
|
||||||
|
|
||||||
factors = [0.3, 0.1, 2, 10, 100, 0.01, 0.5]
|
factors = [0.3, 0.1, 2, 10, 100, 0.01, 0.5]
|
||||||
|
|
|
@ -2196,7 +2196,7 @@ class KeplersSecondLaw(AskAboutEllipses):
|
||||||
self.show_area_sweep()
|
self.show_area_sweep()
|
||||||
end_prop = orbit.proportion
|
end_prop = orbit.proportion
|
||||||
arc = self.get_arc(start_prop, end_prop)
|
arc = self.get_arc(start_prop, end_prop)
|
||||||
radius = Line(sun_point, arc.points[0])
|
radius = Line(sun_point, arc.get_points()[0])
|
||||||
radius.set_color(WHITE)
|
radius.set_color(WHITE)
|
||||||
|
|
||||||
radius_words = self.get_radius_words(radius, "Short")
|
radius_words = self.get_radius_words(radius, "Short")
|
||||||
|
@ -2233,7 +2233,7 @@ class KeplersSecondLaw(AskAboutEllipses):
|
||||||
self.show_area_sweep()
|
self.show_area_sweep()
|
||||||
end_prop = orbit.proportion
|
end_prop = orbit.proportion
|
||||||
short_arc = self.get_arc(start_prop, end_prop)
|
short_arc = self.get_arc(start_prop, end_prop)
|
||||||
long_radius = Line(sun_point, short_arc.points[0])
|
long_radius = Line(sun_point, short_arc.get_points()[0])
|
||||||
long_radius.set_color(WHITE)
|
long_radius.set_color(WHITE)
|
||||||
long_radius_words = self.get_radius_words(long_radius, "Long")
|
long_radius_words = self.get_radius_words(long_radius, "Long")
|
||||||
|
|
||||||
|
@ -2281,11 +2281,11 @@ class KeplersSecondLaw(AskAboutEllipses):
|
||||||
# Add lines from start
|
# Add lines from start
|
||||||
result = VMobject()
|
result = VMobject()
|
||||||
result.append_vectorized_mobject(
|
result.append_vectorized_mobject(
|
||||||
Line(sun_point, arc.points[0])
|
Line(sun_point, arc.get_points()[0])
|
||||||
)
|
)
|
||||||
result.append_vectorized_mobject(arc)
|
result.append_vectorized_mobject(arc)
|
||||||
result.append_vectorized_mobject(
|
result.append_vectorized_mobject(
|
||||||
Line(arc.points[-1], sun_point)
|
Line(arc.get_points()[-1], sun_point)
|
||||||
)
|
)
|
||||||
|
|
||||||
result.set_stroke(WHITE, width=0)
|
result.set_stroke(WHITE, width=0)
|
||||||
|
@ -3097,11 +3097,11 @@ class ShowEqualAngleSlices(IntroduceShapeOfVelocities):
|
||||||
|
|
||||||
wedge = VMobject()
|
wedge = VMobject()
|
||||||
wedge.append_vectorized_mobject(
|
wedge.append_vectorized_mobject(
|
||||||
Line(sun_center, arc.points[0])
|
Line(sun_center, arc.get_points()[0])
|
||||||
)
|
)
|
||||||
wedge.append_vectorized_mobject(arc)
|
wedge.append_vectorized_mobject(arc)
|
||||||
wedge.append_vectorized_mobject(
|
wedge.append_vectorized_mobject(
|
||||||
Line(arc.points[-1], sun_center)
|
Line(arc.get_points()[-1], sun_center)
|
||||||
)
|
)
|
||||||
wedges.add(wedge)
|
wedges.add(wedge)
|
||||||
|
|
||||||
|
@ -3336,7 +3336,7 @@ class ShowEqualAngleSlices(IntroduceShapeOfVelocities):
|
||||||
self.wait()
|
self.wait()
|
||||||
|
|
||||||
self.play(
|
self.play(
|
||||||
comet.move_to, arc.points[0],
|
comet.move_to, arc.get_points()[0],
|
||||||
path_arc=90 * DEGREES
|
path_arc=90 * DEGREES
|
||||||
)
|
)
|
||||||
force_vector_update.update(0)
|
force_vector_update.update(0)
|
||||||
|
@ -4125,11 +4125,11 @@ class UseVelocityDiagramToDeduceCurve(ShowEqualAngleSlices):
|
||||||
def get_wedge(self, arc, center_point, opacity=0.8):
|
def get_wedge(self, arc, center_point, opacity=0.8):
|
||||||
wedge = VMobject()
|
wedge = VMobject()
|
||||||
wedge.append_vectorized_mobject(
|
wedge.append_vectorized_mobject(
|
||||||
Line(center_point, arc.points[0])
|
Line(center_point, arc.get_points()[0])
|
||||||
)
|
)
|
||||||
wedge.append_vectorized_mobject(arc)
|
wedge.append_vectorized_mobject(arc)
|
||||||
wedge.append_vectorized_mobject(
|
wedge.append_vectorized_mobject(
|
||||||
Line(arc.points[-1], center_point)
|
Line(arc.get_points()[-1], center_point)
|
||||||
)
|
)
|
||||||
wedge.set_stroke(width=0)
|
wedge.set_stroke(width=0)
|
||||||
wedge.set_fill(COBALT, opacity=opacity)
|
wedge.set_fill(COBALT, opacity=opacity)
|
||||||
|
|
|
@ -44,7 +44,7 @@ class LabelTracksLine(Animation):
|
||||||
|
|
||||||
def interpolate_mobject(self,alpha):
|
def interpolate_mobject(self,alpha):
|
||||||
line_center = self.line.get_center()
|
line_center = self.line.get_center()
|
||||||
line_end = self.line.points[-1]
|
line_end = self.line.get_points()[-1]
|
||||||
v = line_end - line_center
|
v = line_end - line_center
|
||||||
v = v/get_norm(v)
|
v = v/get_norm(v)
|
||||||
w = np.array([-v[1],v[0],0])
|
w = np.array([-v[1],v[0],0])
|
||||||
|
@ -220,7 +220,7 @@ def get_image(name):
|
||||||
def get_circle_drawing_terms(radius = 1, positioning_func = lambda m : m.center()):
|
def get_circle_drawing_terms(radius = 1, positioning_func = lambda m : m.center()):
|
||||||
circle = Circle(color = YELLOW, radius = 1.25)
|
circle = Circle(color = YELLOW, radius = 1.25)
|
||||||
positioning_func(circle)
|
positioning_func(circle)
|
||||||
radius = Line(circle.get_center(), circle.points[0])
|
radius = Line(circle.get_center(), circle.get_points()[0])
|
||||||
radius.set_color(WHITE)
|
radius.set_color(WHITE)
|
||||||
one = TexMobject("1")
|
one = TexMobject("1")
|
||||||
one.scale(0.75)
|
one.scale(0.75)
|
||||||
|
@ -459,7 +459,7 @@ class HistoryOfOurPeople(TeacherStudentsScene):
|
||||||
class TauFalls(Scene):
|
class TauFalls(Scene):
|
||||||
def construct(self):
|
def construct(self):
|
||||||
tau = TauCreature()
|
tau = TauCreature()
|
||||||
bottom = np.min(tau.body.points[:,1])*UP
|
bottom = np.min(tau.body.get_points()[:,1])*UP
|
||||||
angle = -0.15*TAU
|
angle = -0.15*TAU
|
||||||
tau.generate_target()
|
tau.generate_target()
|
||||||
tau.target.change("angry")
|
tau.target.change("angry")
|
||||||
|
|
|
@ -1199,7 +1199,7 @@ class RuleForQuaternionRotations(EulerAnglesAndGimbal):
|
||||||
label.to_corner(UL)
|
label.to_corner(UL)
|
||||||
brace = Brace(half_angle_q, DOWN)
|
brace = Brace(half_angle_q, DOWN)
|
||||||
q_label = brace.get_tex("q")
|
q_label = brace.get_tex("q")
|
||||||
full_angle_q.align_data(half_angle_q)
|
full_angle_q.align_data_and_family(half_angle_q)
|
||||||
rect = SurroundingRectangle(full_angle_q[5])
|
rect = SurroundingRectangle(full_angle_q[5])
|
||||||
|
|
||||||
for mob in full_angle_q, half_angle_q, brace, q_label, rect:
|
for mob in full_angle_q, half_angle_q, brace, q_label, rect:
|
||||||
|
|
|
@ -23,7 +23,7 @@ def stereo_project_point(point, axis=0, r=1, max_norm=10000):
|
||||||
def stereo_project(mobject, axis=0, r=1, outer_r=10, **kwargs):
|
def stereo_project(mobject, axis=0, r=1, outer_r=10, **kwargs):
|
||||||
epsilon = 1
|
epsilon = 1
|
||||||
for submob in mobject.family_members_with_points():
|
for submob in mobject.family_members_with_points():
|
||||||
points = submob.points
|
points = submob.get_points()
|
||||||
n = len(points)
|
n = len(points)
|
||||||
for i in range(n):
|
for i in range(n):
|
||||||
if points[i, axis] == -r:
|
if points[i, axis] == -r:
|
||||||
|
@ -44,10 +44,10 @@ def stereo_project(mobject, axis=0, r=1, outer_r=10, **kwargs):
|
||||||
|
|
||||||
# If all points are outside a certain range, this
|
# If all points are outside a certain range, this
|
||||||
# shouldn't be displayed
|
# shouldn't be displayed
|
||||||
norms = np.apply_along_axis(get_norm, 1, submob.points)
|
norms = np.apply_along_axis(get_norm, 1, submob.get_points())
|
||||||
if np.all(norms > outer_r):
|
if np.all(norms > outer_r):
|
||||||
# TODO, instead set opacity?
|
# TODO, instead set opacity?
|
||||||
# submob.points[:, :] = 0
|
# submob.get_points()[:, :] = 0
|
||||||
submob.set_fill(opacity=0)
|
submob.set_fill(opacity=0)
|
||||||
submob.set_stroke(opacity=0)
|
submob.set_stroke(opacity=0)
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ class CheckeredCircle(Circle):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
Circle.__init__(self, **kwargs)
|
Circle.__init__(self, **kwargs)
|
||||||
pieces = self.get_pieces(self.n_pieces)
|
pieces = self.get_pieces(self.n_pieces)
|
||||||
self.points = np.zeros((0, 3))
|
self.set_points(np.zeros((0, 3)))
|
||||||
self.add(*pieces)
|
self.add(*pieces)
|
||||||
n_colors = len(self.colors)
|
n_colors = len(self.colors)
|
||||||
for i, color in enumerate(self.colors):
|
for i, color in enumerate(self.colors):
|
||||||
|
@ -320,7 +320,7 @@ class StereoProjectedCircleFromHypersphere(CheckeredCircle):
|
||||||
|
|
||||||
def remove_large_pieces(self):
|
def remove_large_pieces(self):
|
||||||
for piece in self:
|
for piece in self:
|
||||||
length = get_norm(piece.points[0] - piece.points[-1])
|
length = get_norm(piece.get_points()[0] - piece.get_points()[-1])
|
||||||
violations = [
|
violations = [
|
||||||
length > self.max_length,
|
length > self.max_length,
|
||||||
get_norm(piece.get_center()) > self.max_r,
|
get_norm(piece.get_center()) > self.max_r,
|
||||||
|
@ -344,11 +344,11 @@ class QuaternionTracker(ValueTracker):
|
||||||
self.add_updater(lambda q: q.normalize())
|
self.add_updater(lambda q: q.normalize())
|
||||||
|
|
||||||
def set_value(self, vector):
|
def set_value(self, vector):
|
||||||
self.points = np.array(vector).reshape((1, 4))
|
self.set_points(np.array(vector).reshape((1, 4)))
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def get_value(self):
|
def get_value(self):
|
||||||
return self.points[0]
|
return self.get_points()[0]
|
||||||
|
|
||||||
def normalize(self):
|
def normalize(self):
|
||||||
self.set_value(normalize(
|
self.set_value(normalize(
|
||||||
|
@ -1595,8 +1595,8 @@ class DefineComplexNumbersPurelyAlgebraically(Scene):
|
||||||
brace.get_bottom() + SMALL_BUFF * DOWN,
|
brace.get_bottom() + SMALL_BUFF * DOWN,
|
||||||
target.get_top() + MED_SMALL_BUFF * UP,
|
target.get_top() + MED_SMALL_BUFF * UP,
|
||||||
)
|
)
|
||||||
arrow.points[1] = arrow.points[0] + DOWN
|
arrow.get_points()[1] = arrow.get_points()[0] + DOWN
|
||||||
arrow.points[2] = arrow.points[3] + UP
|
arrow.get_points()[2] = arrow.get_points()[3] + UP
|
||||||
tip = RegularPolygon(3, start_angle=-100 * DEGREES)
|
tip = RegularPolygon(3, start_angle=-100 * DEGREES)
|
||||||
tip.set_height(0.2)
|
tip.set_height(0.2)
|
||||||
tip.set_stroke(width=0)
|
tip.set_stroke(width=0)
|
||||||
|
@ -2568,7 +2568,7 @@ class IntroduceStereographicProjection(MovingCameraScene):
|
||||||
n = self.n_sample_points
|
n = self.n_sample_points
|
||||||
rotater = 1
|
rotater = 1
|
||||||
if hasattr(self, "circle_shadow"):
|
if hasattr(self, "circle_shadow"):
|
||||||
point = self.circle_shadow[0].points[0]
|
point = self.circle_shadow[0].get_points()[0]
|
||||||
rotater = complex(*point[:2])
|
rotater = complex(*point[:2])
|
||||||
rotater /= abs(rotater)
|
rotater /= abs(rotater)
|
||||||
numbers = [
|
numbers = [
|
||||||
|
@ -2634,7 +2634,7 @@ class IntroduceStereographicProjectionLinusView(IntroduceStereographicProjection
|
||||||
dots.set_stroke(BLACK, 1)
|
dots.set_stroke(BLACK, 1)
|
||||||
|
|
||||||
def generate_dot_updater(circle_piece):
|
def generate_dot_updater(circle_piece):
|
||||||
return lambda d: d.move_to(circle_piece.points[0])
|
return lambda d: d.move_to(circle_piece.get_points()[0])
|
||||||
|
|
||||||
for dot, piece in zip(dots, circle[::(len(circle) // 8)]):
|
for dot, piece in zip(dots, circle[::(len(circle) // 8)]):
|
||||||
dot.add_updater(generate_dot_updater(piece))
|
dot.add_updater(generate_dot_updater(piece))
|
||||||
|
@ -2834,7 +2834,7 @@ class ShowRotationUnderStereographicProjection(IntroduceStereographicProjection)
|
||||||
lines = always_redraw(self.get_lines)
|
lines = always_redraw(self.get_lines)
|
||||||
|
|
||||||
def generate_dot_updater(circle_piece):
|
def generate_dot_updater(circle_piece):
|
||||||
return lambda d: d.move_to(circle_piece.points[0])
|
return lambda d: d.move_to(circle_piece.get_points()[0])
|
||||||
|
|
||||||
for circ, color in [(self.circle_shadow, RED), (self.circle, WHITE)]:
|
for circ, color in [(self.circle_shadow, RED), (self.circle, WHITE)]:
|
||||||
for piece in circ[::(len(circ) // 8)]:
|
for piece in circ[::(len(circ) // 8)]:
|
||||||
|
@ -2861,7 +2861,7 @@ class ShowRotationUnderStereographicProjection(IntroduceStereographicProjection)
|
||||||
circle_shadow = self.circle_shadow
|
circle_shadow = self.circle_shadow
|
||||||
|
|
||||||
def get_rotated_one_point():
|
def get_rotated_one_point():
|
||||||
return circle_shadow[0].points[0]
|
return circle_shadow[0].get_points()[0]
|
||||||
|
|
||||||
def get_angle():
|
def get_angle():
|
||||||
return angle_of_vector(get_rotated_one_point())
|
return angle_of_vector(get_rotated_one_point())
|
||||||
|
@ -3618,7 +3618,7 @@ class TwoDStereographicProjection(IntroduceFelix):
|
||||||
circle_path.rotate(-90 * DEGREES)
|
circle_path.rotate(-90 * DEGREES)
|
||||||
|
|
||||||
self.play(FadeInFromLarge(circle))
|
self.play(FadeInFromLarge(circle))
|
||||||
self.play(point_mob.move_to, circle_path.points[0])
|
self.play(point_mob.move_to, circle_path.get_points()[0])
|
||||||
self.play(MoveAlongPath(point_mob, circle_path, run_time=6))
|
self.play(MoveAlongPath(point_mob, circle_path, run_time=6))
|
||||||
self.move_camera(
|
self.move_camera(
|
||||||
phi=0,
|
phi=0,
|
||||||
|
@ -5589,10 +5589,10 @@ class ShowMultiplicationBy135Example(RuleOfQuaternionMultiplication):
|
||||||
label.set_background_stroke(width=0)
|
label.set_background_stroke(width=0)
|
||||||
|
|
||||||
def get_one_point():
|
def get_one_point():
|
||||||
return self.circle_1i[0].points[0]
|
return self.circle_1i[0].get_points()[0]
|
||||||
|
|
||||||
def get_j_point():
|
def get_j_point():
|
||||||
return self.circle_jk[0].points[0]
|
return self.circle_jk[0].get_points()[0]
|
||||||
|
|
||||||
one_point = VectorizedPoint()
|
one_point = VectorizedPoint()
|
||||||
one_point.add_updater(lambda v: v.set_location(get_one_point()))
|
one_point.add_updater(lambda v: v.set_location(get_one_point()))
|
||||||
|
@ -5834,7 +5834,7 @@ class ShowArbitraryMultiplication(ShowMultiplicationBy135Example):
|
||||||
one_dot.set_color(YELLOW_E)
|
one_dot.set_color(YELLOW_E)
|
||||||
one_dot.move_to(ORIGIN)
|
one_dot.move_to(ORIGIN)
|
||||||
one_dot.add_updater(
|
one_dot.add_updater(
|
||||||
lambda m: m.move_to(circle1[0].points[0])
|
lambda m: m.move_to(circle1[0].get_points()[0])
|
||||||
)
|
)
|
||||||
self.add(one_dot)
|
self.add(one_dot)
|
||||||
|
|
||||||
|
@ -5852,7 +5852,7 @@ class ShowArbitraryMultiplication(ShowMultiplicationBy135Example):
|
||||||
run_time=2
|
run_time=2
|
||||||
)
|
)
|
||||||
hand.add_updater(
|
hand.add_updater(
|
||||||
lambda h: h.move_to(circle1[0].points[0], LEFT)
|
lambda h: h.move_to(circle1[0].get_points()[0], LEFT)
|
||||||
)
|
)
|
||||||
|
|
||||||
for quat in [special_q, [1, 0, 0, 0], special_q]:
|
for quat in [special_q, [1, 0, 0, 0], special_q]:
|
||||||
|
@ -6367,8 +6367,8 @@ class ThumbnailP1(RuleOfQuaternionMultiplication):
|
||||||
# unit_sphere.set_stroke(width=0)
|
# unit_sphere.set_stroke(width=0)
|
||||||
# proj_sphere.set_fill_by_checkerboard(BLUE_E, BLUE, opacity=0.8)
|
# proj_sphere.set_fill_by_checkerboard(BLUE_E, BLUE, opacity=0.8)
|
||||||
for face in proj_sphere:
|
for face in proj_sphere:
|
||||||
face.points = face.points[::-1]
|
face.set_points(face.get_points()[::-1])
|
||||||
max_r = np.max(np.apply_along_axis(get_norm, 1, face.points))
|
max_r = np.max(np.apply_along_axis(get_norm, 1, face.get_points()))
|
||||||
if max_r > 30:
|
if max_r > 30:
|
||||||
face.fade(1)
|
face.fade(1)
|
||||||
|
|
||||||
|
|
|
@ -2568,7 +2568,7 @@ class UnwrappedCircleLogic(UnfoldCircles):
|
||||||
line_word.shift(line.get_center())
|
line_word.shift(line.get_center())
|
||||||
|
|
||||||
curve = line.copy()
|
curve = line.copy()
|
||||||
curve.points[1] = unwrapped_circle.get_corner(DL)
|
curve.get_points()[1] = unwrapped_circle.get_corner(DL)
|
||||||
not_line = TextMobject("Not line")
|
not_line = TextMobject("Not line")
|
||||||
not_line.rotate(line.get_angle() / 2)
|
not_line.rotate(line.get_angle() / 2)
|
||||||
not_line.move_to(line_word)
|
not_line.move_to(line_word)
|
||||||
|
@ -2898,7 +2898,7 @@ class SecondProof(SpecialThreeDScene):
|
||||||
|
|
||||||
# shaded_back_half = back_half.copy()
|
# shaded_back_half = back_half.copy()
|
||||||
# for piece in shaded_back_half.family_members_with_points():
|
# for piece in shaded_back_half.family_members_with_points():
|
||||||
# piece.points = piece.points[::-1]
|
# piece.set_points(piece.get_points()[::-1])
|
||||||
# shaded_back_half.scale(0.999)
|
# shaded_back_half.scale(0.999)
|
||||||
# shaded_back_half.set_fill(opacity=0.5)
|
# shaded_back_half.set_fill(opacity=0.5)
|
||||||
|
|
||||||
|
@ -3208,10 +3208,10 @@ class SecondProof(SpecialThreeDScene):
|
||||||
for piece in ring:
|
for piece in ring:
|
||||||
piece.insert_n_curves(4)
|
piece.insert_n_curves(4)
|
||||||
piece.on_sphere = True
|
piece.on_sphere = True
|
||||||
piece.points = np.array([
|
piece.set_points([
|
||||||
*piece.points[3:-1],
|
*piece.get_points()[3:-1],
|
||||||
*piece.points[:3],
|
*piece.get_points()[:3],
|
||||||
piece.points[3]
|
piece.get_points()[3]
|
||||||
])
|
])
|
||||||
return rings
|
return rings
|
||||||
|
|
||||||
|
@ -3239,7 +3239,7 @@ class SecondProof(SpecialThreeDScene):
|
||||||
|
|
||||||
def get_theta(self, ring):
|
def get_theta(self, ring):
|
||||||
piece = ring[0]
|
piece = ring[0]
|
||||||
point = piece.points[3]
|
point = piece.get_points()[3]
|
||||||
return np.arccos(point[2] / get_norm(point))
|
return np.arccos(point[2] / get_norm(point))
|
||||||
|
|
||||||
def get_theta_group(self, theta):
|
def get_theta_group(self, theta):
|
||||||
|
|
|
@ -175,7 +175,7 @@ class RadarPulseSingleton(ContinualAnimation):
|
||||||
)
|
)
|
||||||
self.arc.set_height(0.75*radar_dish.get_height())
|
self.arc.set_height(0.75*radar_dish.get_height())
|
||||||
self.arc.move_to(radar_dish, UP+RIGHT)
|
self.arc.move_to(radar_dish, UP+RIGHT)
|
||||||
self.start_points = np.array(self.arc.points)
|
self.start_points = np.array(self.arc.get_points())
|
||||||
self.start_center = self.arc.get_center()
|
self.start_center = self.arc.get_center()
|
||||||
self.finished = False
|
self.finished = False
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ class RadarPulseSingleton(ContinualAnimation):
|
||||||
def update_mobject(self, dt):
|
def update_mobject(self, dt):
|
||||||
arc = self.arc
|
arc = self.arc
|
||||||
total_distance = self.speed*self.internal_time
|
total_distance = self.speed*self.internal_time
|
||||||
arc.points = np.array(self.start_points)
|
arc.set_points(self.start_points)
|
||||||
arc.shift(total_distance*self.direction)
|
arc.shift(total_distance*self.direction)
|
||||||
|
|
||||||
if self.internal_time < self.fade_in_time:
|
if self.internal_time < self.fade_in_time:
|
||||||
|
@ -202,10 +202,10 @@ class RadarPulseSingleton(ContinualAnimation):
|
||||||
#Don't use elif in case the above code creates reflection_distance
|
#Don't use elif in case the above code creates reflection_distance
|
||||||
if self.reflection_distance is not None:
|
if self.reflection_distance is not None:
|
||||||
delta_distance = total_distance - self.reflection_distance
|
delta_distance = total_distance - self.reflection_distance
|
||||||
point_distances = np.dot(self.direction, arc.points.T)
|
point_distances = np.dot(self.direction, arc.get_points().T)
|
||||||
diffs = point_distances - self.reflection_distance
|
diffs = point_distances - self.reflection_distance
|
||||||
shift_vals = np.outer(-2*np.maximum(diffs, 0), self.direction)
|
shift_vals = np.outer(-2*np.maximum(diffs, 0), self.direction)
|
||||||
arc.points += shift_vals
|
arc.set_points(arc.get_points() + shift_vals)
|
||||||
|
|
||||||
#Check if done
|
#Check if done
|
||||||
arc_point = arc.get_edge_center(-self.direction)
|
arc_point = arc.get_edge_center(-self.direction)
|
||||||
|
@ -869,8 +869,8 @@ class TwoCarsAtRedLight(Scene):
|
||||||
new_frequency_graph.match_color(self.frequency_graph)
|
new_frequency_graph.match_color(self.frequency_graph)
|
||||||
|
|
||||||
def pin_freq_graph_end_points(freq_graph):
|
def pin_freq_graph_end_points(freq_graph):
|
||||||
freq_graph.points[0] = frequency_axes.coords_to_point(0, 0)
|
freq_graph.get_points()[0] = frequency_axes.coords_to_point(0, 0)
|
||||||
freq_graph.points[-1] = frequency_axes.coords_to_point(2, 0)
|
freq_graph.get_points()[-1] = frequency_axes.coords_to_point(2, 0)
|
||||||
|
|
||||||
self.play(LaggedStartMap(
|
self.play(LaggedStartMap(
|
||||||
FadeOut, VGroup(
|
FadeOut, VGroup(
|
||||||
|
@ -973,7 +973,7 @@ class VariousMusicalNotes(Scene):
|
||||||
)
|
)
|
||||||
graph = get_graph()
|
graph = get_graph()
|
||||||
def graph_update(graph):
|
def graph_update(graph):
|
||||||
graph.points = get_graph().points
|
graph.set_points(get_graph().get_points())
|
||||||
graph_update_anim = UpdateFromFunc(graph, graph_update)
|
graph_update_anim = UpdateFromFunc(graph, graph_update)
|
||||||
def change_width_anim(width, **kwargs):
|
def change_width_anim(width, **kwargs):
|
||||||
a = 2.0/(width**2)
|
a = 2.0/(width**2)
|
||||||
|
@ -3960,9 +3960,9 @@ class MusicalNote(AddingPureFrequencies):
|
||||||
v_line = DashedLine(ORIGIN, 0.5*UP)
|
v_line = DashedLine(ORIGIN, 0.5*UP)
|
||||||
v_line_update = UpdateFromFunc(
|
v_line_update = UpdateFromFunc(
|
||||||
v_line, lambda l : l.put_start_and_end_on_with_projection(
|
v_line, lambda l : l.put_start_and_end_on_with_projection(
|
||||||
graph.points[-1],
|
graph.get_points()[-1],
|
||||||
axes.x_axis.number_to_point(
|
axes.x_axis.number_to_point(
|
||||||
axes.x_axis.point_to_number(graph.points[-1])
|
axes.x_axis.point_to_number(graph.get_points()[-1])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -959,10 +959,10 @@ class TemptingFormula(ShowTwoPerspectives, RandomnessVsProportions):
|
||||||
buff=MED_LARGE_BUFF,
|
buff=MED_LARGE_BUFF,
|
||||||
color=BLUE,
|
color=BLUE,
|
||||||
)
|
)
|
||||||
# B_rect.points[0] += 0.2 * RIGHT
|
# B_rect.get_points()[0] += 0.2 * RIGHT
|
||||||
# B_rect.points[-1] += 0.2 * RIGHT
|
# B_rect.get_points()[-1] += 0.2 * RIGHT
|
||||||
# B_rect.points[3] += 0.2 * LEFT
|
# B_rect.get_points()[3] += 0.2 * LEFT
|
||||||
# B_rect.points[4] += 0.2 * LEFT
|
# B_rect.get_points()[4] += 0.2 * LEFT
|
||||||
# B_rect.make_jagged()
|
# B_rect.make_jagged()
|
||||||
|
|
||||||
self.play(FadeIn(ht_grid_group))
|
self.play(FadeIn(ht_grid_group))
|
||||||
|
|
|
@ -883,8 +883,8 @@ class StateGoal(PiCreatureScene, Scene):
|
||||||
|
|
||||||
rects = VGroup()
|
rects = VGroup()
|
||||||
for curve in CurvesAsSubmobjects(gold):
|
for curve in CurvesAsSubmobjects(gold):
|
||||||
p1 = curve.points[0]
|
p1 = curve.get_points()[0]
|
||||||
p2 = curve.points[-1]
|
p2 = curve.get_points()[-1]
|
||||||
rect = Polygon(p1, p2, p2 + 2 * OUT, p1 + 2 * OUT)
|
rect = Polygon(p1, p2, p2 + 2 * OUT, p1 + 2 * OUT)
|
||||||
rect.match_style(gold)
|
rect.match_style(gold)
|
||||||
# rect.set_fill(GOLD)
|
# rect.set_fill(GOLD)
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Block(Square):
|
||||||
return label
|
return label
|
||||||
|
|
||||||
def get_points_defining_boundary(self):
|
def get_points_defining_boundary(self):
|
||||||
return self.points
|
return self.get_points()
|
||||||
|
|
||||||
def mass_to_color(self, mass):
|
def mass_to_color(self, mass):
|
||||||
colors = [
|
colors = [
|
||||||
|
@ -564,7 +564,7 @@ class LightBouncing(MovingCameraScene):
|
||||||
),
|
),
|
||||||
UpdateFromFunc(
|
UpdateFromFunc(
|
||||||
dot,
|
dot,
|
||||||
lambda m: m.move_to(beam.points[-1])
|
lambda m: m.move_to(beam.get_points()[-1])
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -609,7 +609,7 @@ class AskAboutFindingNewVelocities(Scene):
|
||||||
self.vps_point.rotate(2 * theta, about_point=ORIGIN)
|
self.vps_point.rotate(2 * theta, about_point=ORIGIN)
|
||||||
|
|
||||||
def reflect_block2(self):
|
def reflect_block2(self):
|
||||||
self.vps_point.points[:, 1] *= -1
|
self.vps_point.get_points()[:, 1] *= -1
|
||||||
|
|
||||||
def halt(self):
|
def halt(self):
|
||||||
self.is_halted = True
|
self.is_halted = True
|
||||||
|
@ -1694,7 +1694,7 @@ class AnalyzeCircleGeometry(CircleDiagramFromSlidingBlocks, MovingCameraScene):
|
||||||
|
|
||||||
wedge = arc.copy()
|
wedge = arc.copy()
|
||||||
wedge.add_line_to(ORIGIN)
|
wedge.add_line_to(ORIGIN)
|
||||||
wedge.add_line_to(wedge.points[0])
|
wedge.add_line_to(wedge.get_points()[0])
|
||||||
wedge.set_stroke(width=0)
|
wedge.set_stroke(width=0)
|
||||||
wedge.set_fill(arc.get_color(), 0.2)
|
wedge.set_fill(arc.get_color(), 0.2)
|
||||||
wedges.add(wedge)
|
wedges.add(wedge)
|
||||||
|
@ -2558,7 +2558,7 @@ class ActanAndTanGraphs(GraphScene):
|
||||||
labels = VGroup(id_label, arctan_label, tan_label)
|
labels = VGroup(id_label, arctan_label, tan_label)
|
||||||
for label, graph in zip(labels, graphs):
|
for label, graph in zip(labels, graphs):
|
||||||
label.match_color(graph)
|
label.match_color(graph)
|
||||||
label.next_to(graph.points[-1], RIGHT)
|
label.next_to(graph.get_points()[-1], RIGHT)
|
||||||
if label.get_bottom()[1] > FRAME_HEIGHT / 2:
|
if label.get_bottom()[1] > FRAME_HEIGHT / 2:
|
||||||
label.next_to(graph.point_from_proportion(0.75), LEFT)
|
label.next_to(graph.point_from_proportion(0.75), LEFT)
|
||||||
|
|
||||||
|
|
|
@ -343,7 +343,7 @@ class MirrorScene(Scene):
|
||||||
result.append(
|
result.append(
|
||||||
UpdateFromFunc(
|
UpdateFromFunc(
|
||||||
self.beam_point,
|
self.beam_point,
|
||||||
lambda m: m.move_to(smallest_flash.mobject.points[-1])
|
lambda m: m.move_to(smallest_flash.mobject.get_points()[-1])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ class MirrorScene(Scene):
|
||||||
)
|
)
|
||||||
ghost_beam_point_update = UpdateFromFunc(
|
ghost_beam_point_update = UpdateFromFunc(
|
||||||
self.ghost_beam_point,
|
self.ghost_beam_point,
|
||||||
lambda m: m.move_to(ghost_flash.mobject.points[-1])
|
lambda m: m.move_to(ghost_flash.mobject.get_points()[-1])
|
||||||
)
|
)
|
||||||
result += [
|
result += [
|
||||||
ghost_flash,
|
ghost_flash,
|
||||||
|
@ -435,7 +435,7 @@ class ReflectWorldThroughMirrorNew(MirrorScene):
|
||||||
randy.tracked_mobject = self.trajectory
|
randy.tracked_mobject = self.trajectory
|
||||||
randy.add_updater(
|
randy.add_updater(
|
||||||
lambda m: m.look_at(
|
lambda m: m.look_at(
|
||||||
m.tracked_mobject.points[-1]
|
m.tracked_mobject.get_points()[-1]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.add(randy)
|
self.add(randy)
|
||||||
|
@ -450,7 +450,7 @@ class ReflectWorldThroughMirrorNew(MirrorScene):
|
||||||
def add_ghost_beam_point(self):
|
def add_ghost_beam_point(self):
|
||||||
self.ghost_beam_point.add_updater(
|
self.ghost_beam_point.add_updater(
|
||||||
lambda m: m.move_to(
|
lambda m: m.move_to(
|
||||||
self.ghost_trajectory.points[-1]
|
self.ghost_trajectory.get_points()[-1]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.add(self.ghost_beam_point)
|
self.add(self.ghost_beam_point)
|
||||||
|
@ -658,7 +658,7 @@ class ReflectWorldThroughMirrorNew(MirrorScene):
|
||||||
self.ghost_beam_point.clear_updaters()
|
self.ghost_beam_point.clear_updaters()
|
||||||
self.ghost_beam_point.add_updater(
|
self.ghost_beam_point.add_updater(
|
||||||
lambda m: m.move_to(
|
lambda m: m.move_to(
|
||||||
gt_beam_anims[0].mobject.points[-1]
|
gt_beam_anims[0].mobject.get_points()[-1]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.randy.tracked_mobject = t_beam_anims[0].mobject
|
self.randy.tracked_mobject = t_beam_anims[0].mobject
|
||||||
|
@ -927,7 +927,7 @@ class MirrorAndWiresOverlay(MirrorScene):
|
||||||
)
|
)
|
||||||
d_trajectory.match_style(g_trajectory)
|
d_trajectory.match_style(g_trajectory)
|
||||||
|
|
||||||
g_trajectory.points[0] += 0.2 * RIGHT + 0.1 * DOWN
|
g_trajectory.get_points()[0] += 0.2 * RIGHT + 0.1 * DOWN
|
||||||
g_trajectory.make_jagged()
|
g_trajectory.make_jagged()
|
||||||
for x in range(3):
|
for x in range(3):
|
||||||
self.play(
|
self.play(
|
||||||
|
|
|
@ -1014,10 +1014,10 @@ class EqualMassCase(PositionPhaseSpaceScene):
|
||||||
flash_mob = flashes[0].mobject # Lol
|
flash_mob = flashes[0].mobject # Lol
|
||||||
|
|
||||||
def update_ps_point_from_flas_mob(ps_point):
|
def update_ps_point_from_flas_mob(ps_point):
|
||||||
if len(flash_mob.points) > 0:
|
if len(flash_mob.get_points()) > 0:
|
||||||
ps_point.move_to(flash_mob.points[-1])
|
ps_point.move_to(flash_mob.get_points()[-1])
|
||||||
else:
|
else:
|
||||||
ps_point.move_to(trajectory.points[0])
|
ps_point.move_to(trajectory.get_points()[0])
|
||||||
|
|
||||||
# Mirror words
|
# Mirror words
|
||||||
xy_line = self.d1_eq_d2_line
|
xy_line = self.d1_eq_d2_line
|
||||||
|
@ -1097,7 +1097,7 @@ class FailedAngleRelation(PositionPhaseSpaceScene):
|
||||||
arcs = self.get_arcs(trajectory)
|
arcs = self.get_arcs(trajectory)
|
||||||
equation = self.get_word_equation()
|
equation = self.get_word_equation()
|
||||||
equation.next_to(
|
equation.next_to(
|
||||||
trajectory.points[0], UR, MED_SMALL_BUFF,
|
trajectory.get_points()[0], UR, MED_SMALL_BUFF,
|
||||||
index_of_submobject_to_align=0,
|
index_of_submobject_to_align=0,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1350,7 +1350,7 @@ class RescaleCoordinates(PositionPhaseSpaceScene, MovingCameraScene):
|
||||||
def put_into_frame(self):
|
def put_into_frame(self):
|
||||||
rect = ScreenRectangle(height=FRAME_HEIGHT + 10)
|
rect = ScreenRectangle(height=FRAME_HEIGHT + 10)
|
||||||
inner_rect = ScreenRectangle(height=FRAME_HEIGHT)
|
inner_rect = ScreenRectangle(height=FRAME_HEIGHT)
|
||||||
rect.add_subpath(inner_rect.points[::-1])
|
rect.add_subpath(inner_rect.get_points()[::-1])
|
||||||
rect.set_fill("#333333", opacity=1)
|
rect.set_fill("#333333", opacity=1)
|
||||||
frame = self.camera_frame
|
frame = self.camera_frame
|
||||||
|
|
||||||
|
|
|
@ -940,7 +940,7 @@ class WherePendulumLeads(PiCreatureScene):
|
||||||
|
|
||||||
weight = Dot(radius=0.25)
|
weight = Dot(radius=0.25)
|
||||||
weight.add_updater(lambda m: m.move_to(
|
weight.add_updater(lambda m: m.move_to(
|
||||||
spring.points[-1]
|
spring.get_points()[-1]
|
||||||
))
|
))
|
||||||
weight.set_color(BLUE)
|
weight.set_color(BLUE)
|
||||||
weight.set_sheen(1, UL)
|
weight.set_sheen(1, UL)
|
||||||
|
|
|
@ -503,7 +503,7 @@ class VisualizeStates(Scene):
|
||||||
|
|
||||||
def update_trajectory(traj):
|
def update_trajectory(traj):
|
||||||
point = mobject.get_center()
|
point = mobject.get_center()
|
||||||
if get_norm(trajectory.points[-1] == point) > 0.05:
|
if get_norm(trajectory.get_points()[-1] == point) > 0.05:
|
||||||
traj.add_smooth_curve_to(point)
|
traj.add_smooth_curve_to(point)
|
||||||
trajectory.add_updater(update_trajectory)
|
trajectory.add_updater(update_trajectory)
|
||||||
return trajectory
|
return trajectory
|
||||||
|
@ -699,7 +699,7 @@ class IntroduceVectorField(VisualizeStates):
|
||||||
trajectory.start_new_path(dot.get_center())
|
trajectory.start_new_path(dot.get_center())
|
||||||
dt = 0.01
|
dt = 0.01
|
||||||
for x in range(130):
|
for x in range(130):
|
||||||
p = trajectory.points[-1]
|
p = trajectory.get_points()[-1]
|
||||||
dp_dt = self.vector_field_func(p)
|
dp_dt = self.vector_field_func(p)
|
||||||
trajectory.add_smooth_curve_to(p + dp_dt * dt)
|
trajectory.add_smooth_curve_to(p + dp_dt * dt)
|
||||||
self.tie_state_to_dot_position(state, dot)
|
self.tie_state_to_dot_position(state, dot)
|
||||||
|
@ -1010,7 +1010,7 @@ class ShowHighVelocityCase(ShowPendulumPhaseFlow, MovingCameraScene):
|
||||||
rate_func=linear,
|
rate_func=linear,
|
||||||
),
|
),
|
||||||
UpdateFromFunc(
|
UpdateFromFunc(
|
||||||
dot, lambda d: d.move_to(traj.points[-1])
|
dot, lambda d: d.move_to(traj.get_points()[-1])
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
if get_norm(self.frame_shift_vect) > 0:
|
if get_norm(self.frame_shift_vect) > 0:
|
||||||
|
@ -1030,7 +1030,7 @@ class ShowHighVelocityCase(ShowPendulumPhaseFlow, MovingCameraScene):
|
||||||
traj = VMobject()
|
traj = VMobject()
|
||||||
traj.start_new_path(start_point)
|
traj.start_new_path(start_point)
|
||||||
for x in range(int(time / dt)):
|
for x in range(int(time / dt)):
|
||||||
last_point = traj.points[-1]
|
last_point = traj.get_points()[-1]
|
||||||
for y in range(added_steps):
|
for y in range(added_steps):
|
||||||
dp_dt = field.func(last_point)
|
dp_dt = field.func(last_point)
|
||||||
last_point += dp_dt * dt / added_steps
|
last_point += dp_dt * dt / added_steps
|
||||||
|
@ -1242,7 +1242,7 @@ class SpectrumOfStartingStates(ShowHighVelocityCase):
|
||||||
|
|
||||||
def update_dots(ds):
|
def update_dots(ds):
|
||||||
for d, t in zip(ds, trajs):
|
for d, t in zip(ds, trajs):
|
||||||
d.move_to(t.points[-1])
|
d.move_to(t.get_points()[-1])
|
||||||
return ds
|
return ds
|
||||||
dots.add_updater(update_dots)
|
dots.add_updater(update_dots)
|
||||||
|
|
||||||
|
@ -1362,7 +1362,7 @@ class AskAboutStability(ShowHighVelocityCase):
|
||||||
|
|
||||||
def update_dots(ds):
|
def update_dots(ds):
|
||||||
for t, d in zip(trajs, ds):
|
for t, d in zip(trajs, ds):
|
||||||
d.move_to(t.points[-1])
|
d.move_to(t.get_points()[-1])
|
||||||
dots.add_updater(update_dots)
|
dots.add_updater(update_dots)
|
||||||
self.add(trajs, dots)
|
self.add(trajs, dots)
|
||||||
self.play(
|
self.play(
|
||||||
|
@ -1522,7 +1522,7 @@ class LovePhaseSpace(ShowHighVelocityCase):
|
||||||
|
|
||||||
def update_dots(ds):
|
def update_dots(ds):
|
||||||
for d, t in zip(ds, ds.trajs):
|
for d, t in zip(ds, ds.trajs):
|
||||||
d.move_to(t.points[-1])
|
d.move_to(t.get_points()[-1])
|
||||||
dots.add_updater(update_dots)
|
dots.add_updater(update_dots)
|
||||||
|
|
||||||
self.add(trajs, dots)
|
self.add(trajs, dots)
|
||||||
|
|
|
@ -2307,7 +2307,7 @@ class ThreeBodiesInSpace(SpecialThreeDScene):
|
||||||
def add_trajectories(self):
|
def add_trajectories(self):
|
||||||
def update_trajectory(traj, dt):
|
def update_trajectory(traj, dt):
|
||||||
new_point = traj.body.point
|
new_point = traj.body.point
|
||||||
if get_norm(new_point - traj.points[-1]) > 0.01:
|
if get_norm(new_point - traj.get_points()[-1]) > 0.01:
|
||||||
traj.add_smooth_curve_to(new_point)
|
traj.add_smooth_curve_to(new_point)
|
||||||
|
|
||||||
for body in self.bodies:
|
for body in self.bodies:
|
||||||
|
@ -2772,7 +2772,7 @@ class LoveExample(PiCreatureScene):
|
||||||
)
|
)
|
||||||
s_alpha = squish_rate_func(smooth, 0.25, 1)(alpha)
|
s_alpha = squish_rate_func(smooth, 0.25, 1)(alpha)
|
||||||
if s_alpha > 0:
|
if s_alpha > 0:
|
||||||
y.align_data(you_copy)
|
y.align_data_and_family(you_copy)
|
||||||
f1 = y.family_members_with_points()
|
f1 = y.family_members_with_points()
|
||||||
f2 = you_copy.family_members_with_points()
|
f2 = you_copy.family_members_with_points()
|
||||||
for sm1, sm2 in zip(f1, f2):
|
for sm1, sm2 in zip(f1, f2):
|
||||||
|
@ -2827,7 +2827,7 @@ class LoveExample(PiCreatureScene):
|
||||||
)
|
)
|
||||||
s_alpha = squish_rate_func(smooth, 0.25, 1)(alpha)
|
s_alpha = squish_rate_func(smooth, 0.25, 1)(alpha)
|
||||||
if s_alpha > 0:
|
if s_alpha > 0:
|
||||||
t.align_data(tau_copy)
|
t.align_data_and_family(tau_copy)
|
||||||
f1 = t.family_members_with_points()
|
f1 = t.family_members_with_points()
|
||||||
f2 = tau_copy.family_members_with_points()
|
f2 = tau_copy.family_members_with_points()
|
||||||
for sm1, sm2 in zip(f1, f2):
|
for sm1, sm2 in zip(f1, f2):
|
||||||
|
|
|
@ -588,7 +588,7 @@ class FourierNDQ(FourierOfTrebleClef):
|
||||||
path = VMobject()
|
path = VMobject()
|
||||||
shape = TexMobject("NDQ")
|
shape = TexMobject("NDQ")
|
||||||
for sp in shape.family_members_with_points():
|
for sp in shape.family_members_with_points():
|
||||||
path.append_points(sp.points)
|
path.append_points(sp.get_points())
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -471,7 +471,7 @@ class CircleAnimationOfF(FourierOfTrebleClef):
|
||||||
path = VMobject()
|
path = VMobject()
|
||||||
shape = TextMobject("F")
|
shape = TextMobject("F")
|
||||||
for sp in shape.family_members_with_points():
|
for sp in shape.family_members_with_points():
|
||||||
path.append_points(sp.points)
|
path.append_points(sp.get_points())
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,7 @@ class TemperatureGraphScene(SpecialThreeDScene):
|
||||||
axes.x_min,
|
axes.x_min,
|
||||||
t_tracker.get_value(),
|
t_tracker.get_value(),
|
||||||
axes.z_min,
|
axes.z_min,
|
||||||
) - plane.points[0]
|
) - plane.get_points()[0]
|
||||||
))
|
))
|
||||||
plane.t_tracker = t_tracker
|
plane.t_tracker = t_tracker
|
||||||
return plane
|
return plane
|
||||||
|
|
|
@ -253,7 +253,7 @@ class ComplexFourierSeriesExample(FourierOfTrebleClef):
|
||||||
np.clip(alpha - 0.01, 0, 1),
|
np.clip(alpha - 0.01, 0, 1),
|
||||||
np.clip(alpha, 0, 1),
|
np.clip(alpha, 0, 1),
|
||||||
)
|
)
|
||||||
p.points[-1] = vectors[-1].get_end()
|
p.get_points()[-1] = vectors[-1].get_end()
|
||||||
|
|
||||||
path.add_updater(update_path)
|
path.add_updater(update_path)
|
||||||
return path
|
return path
|
||||||
|
|
|
@ -485,12 +485,12 @@ class TriangleModuliSpace(Scene):
|
||||||
self.wait()
|
self.wait()
|
||||||
|
|
||||||
# Adjust triangle
|
# Adjust triangle
|
||||||
tip_tracker = VectorizedPoint(triangle.points[0])
|
tip_tracker = VectorizedPoint(triangle.get_points()[0])
|
||||||
|
|
||||||
def update_triangle(tri):
|
def update_triangle(tri):
|
||||||
point = tip_tracker.get_location()
|
point = tip_tracker.get_location()
|
||||||
tri.points[0] = point
|
tri.get_points()[0] = point
|
||||||
tri.points[-1] = point
|
tri.get_points()[-1] = point
|
||||||
tri.make_jagged()
|
tri.make_jagged()
|
||||||
|
|
||||||
triangle.add_updater(update_triangle)
|
triangle.add_updater(update_triangle)
|
||||||
|
|
|
@ -1331,7 +1331,7 @@ class ShowSpiralsForWholeNumbers(CountSpirals):
|
||||||
for n, spiral in zip(it.count(1), new_spirals):
|
for n, spiral in zip(it.count(1), new_spirals):
|
||||||
count = Integer(n)
|
count = Integer(n)
|
||||||
count.scale(2)
|
count.scale(2)
|
||||||
count.move_to(spiral.points[50])
|
count.move_to(spiral.get_points()[50])
|
||||||
counts.add(count)
|
counts.add(count)
|
||||||
|
|
||||||
self.remove(curr_spiral)
|
self.remove(curr_spiral)
|
||||||
|
@ -4907,7 +4907,7 @@ class Thumbnail(SpiralScene):
|
||||||
fill_color=TEAL,
|
fill_color=TEAL,
|
||||||
# fill_opacity=interpolate(0.5, 1, min(get_norm(point), 1))
|
# fill_opacity=interpolate(0.5, 1, min(get_norm(point), 1))
|
||||||
)
|
)
|
||||||
for point in p_spiral.points
|
for point in p_spiral.get_points()
|
||||||
])
|
])
|
||||||
dots.set_fill([TEAL_E, TEAL_A])
|
dots.set_fill([TEAL_E, TEAL_A])
|
||||||
dots.set_stroke(BLACK, 1)
|
dots.set_stroke(BLACK, 1)
|
||||||
|
|
|
@ -1412,7 +1412,7 @@ class WindmillScene(Scene):
|
||||||
tips.set_stroke(BLACK, 1, background=True)
|
tips.set_stroke(BLACK, 1, background=True)
|
||||||
for tip, a in zip(tips, np.linspace(0, 1, n_tips)):
|
for tip, a in zip(tips, np.linspace(0, 1, n_tips)):
|
||||||
tip.shift(
|
tip.shift(
|
||||||
windmill.point_from_proportion(a) - tip.points[0]
|
windmill.point_from_proportion(a) - tip.get_points()[0]
|
||||||
)
|
)
|
||||||
return tips
|
return tips
|
||||||
|
|
||||||
|
@ -2972,7 +2972,7 @@ class Rotate180Argument(WindmillScene):
|
||||||
self.wait()
|
self.wait()
|
||||||
|
|
||||||
def show_parallel_lines(self):
|
def show_parallel_lines(self):
|
||||||
points = self.points
|
points = self.get_points()
|
||||||
rotation_label = self.rotation_label
|
rotation_label = self.rotation_label
|
||||||
dots = self.dots
|
dots = self.dots
|
||||||
windmill = self.windmill
|
windmill = self.windmill
|
||||||
|
|
|
@ -69,7 +69,7 @@ class ConvolutionIntroduction(ThreeDScene):
|
||||||
|
|
||||||
h, w = kernel.shape
|
h, w = kernel.shape
|
||||||
pixels = np.array([
|
pixels = np.array([
|
||||||
square.fill_rgbas[0]
|
square.data["fill_rgba"][0]
|
||||||
for square in pixel_array
|
for square in pixel_array
|
||||||
]).reshape((height, width, 4))
|
]).reshape((height, width, 4))
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class ConvolutionIntroduction(ThreeDScene):
|
||||||
|
|
||||||
kernel_array.move_to(pixel_array[pos])
|
kernel_array.move_to(pixel_array[pos])
|
||||||
right_rect.move_to(new_array[pos])
|
right_rect.move_to(new_array[pos])
|
||||||
new_array[pos].fill_rgbas[0] = rgba
|
new_array[pos].data["fill_rgba"][0] = rgba
|
||||||
|
|
||||||
def walk(start, stop, time=5, surface=None):
|
def walk(start, stop, time=5, surface=None):
|
||||||
for n in range(start, stop):
|
for n in range(start, stop):
|
||||||
|
|
|
@ -165,7 +165,7 @@ class HighlightReviewParts(Scene):
|
||||||
inv_rects = VGroup()
|
inv_rects = VGroup()
|
||||||
for rect in rects:
|
for rect in rects:
|
||||||
fsr = FullScreenFadeRectangle()
|
fsr = FullScreenFadeRectangle()
|
||||||
fsr.append_points(rect.points[::-1])
|
fsr.append_points(rect.get_points()[::-1])
|
||||||
inv_rects.add(fsr)
|
inv_rects.add(fsr)
|
||||||
|
|
||||||
inv_rects.set_fill(BLACK, 0.85)
|
inv_rects.set_fill(BLACK, 0.85)
|
||||||
|
@ -1552,7 +1552,7 @@ class LookAtAllPossibleSuccessRates(Scene):
|
||||||
graph = axes.get_graph(dist.pdf)
|
graph = axes.get_graph(dist.pdf)
|
||||||
graph.set_stroke(BLUE, 3)
|
graph.set_stroke(BLUE, 3)
|
||||||
flat_graph = graph.copy()
|
flat_graph = graph.copy()
|
||||||
flat_graph.points[:, 1] = axes.c2p(0, 0)[1]
|
flat_graph.get_points()[:, 1] = axes.c2p(0, 0)[1]
|
||||||
flat_graph.set_stroke(YELLOW, 3)
|
flat_graph.set_stroke(YELLOW, 3)
|
||||||
|
|
||||||
x_labels = axes.x_axis.numbers
|
x_labels = axes.x_axis.numbers
|
||||||
|
@ -1956,14 +1956,9 @@ class RunCarFactory(Scene):
|
||||||
self.add(factory)
|
self.add(factory)
|
||||||
|
|
||||||
# Dumb hack
|
# Dumb hack
|
||||||
l1 = Line(
|
points = factory[0].get_points()
|
||||||
factory[0].points[-200],
|
l1 = Line(points[-200], points[-216])
|
||||||
factory[0].points[-216],
|
l2 = Line(points[-300], points[-318])
|
||||||
)
|
|
||||||
l2 = Line(
|
|
||||||
factory[0].points[-300],
|
|
||||||
factory[0].points[-318],
|
|
||||||
)
|
|
||||||
for line in l1, l2:
|
for line in l1, l2:
|
||||||
square = Square()
|
square = Square()
|
||||||
square.set_fill(BLACK, 1)
|
square.set_fill(BLACK, 1)
|
||||||
|
|
|
@ -358,7 +358,6 @@ class ShowInfiniteContinuum(Scene):
|
||||||
# Arrows
|
# Arrows
|
||||||
arrows = VGroup()
|
arrows = VGroup()
|
||||||
arrow_template = Vector(DOWN)
|
arrow_template = Vector(DOWN)
|
||||||
arrow_template.lock_triangulation()
|
|
||||||
|
|
||||||
def get_arrow(s, denom, arrow_template=arrow_template, axes=axes):
|
def get_arrow(s, denom, arrow_template=arrow_template, axes=axes):
|
||||||
arrow = arrow_template.copy()
|
arrow = arrow_template.copy()
|
||||||
|
@ -2078,7 +2077,7 @@ class Thumbnail(Scene):
|
||||||
black_arrow.set_color(BLACK)
|
black_arrow.set_color(BLACK)
|
||||||
black_arrow.set_stroke(width=20)
|
black_arrow.set_stroke(width=20)
|
||||||
|
|
||||||
arrow.points[0] += 0.025 * DR
|
arrow.get_points()[0] += 0.025 * DR
|
||||||
|
|
||||||
# Coords
|
# Coords
|
||||||
coords = TexMobject("(x, y) = (0.31415\\dots, 0.27182\\dots)")
|
coords = TexMobject("(x, y) = (0.31415\\dots, 0.27182\\dots)")
|
||||||
|
|
|
@ -923,7 +923,6 @@ class VisualizeBayesRule(Scene):
|
||||||
|
|
||||||
arrows = VGroup()
|
arrows = VGroup()
|
||||||
arrow_template = Vector(DOWN)
|
arrow_template = Vector(DOWN)
|
||||||
arrow_template.lock_triangulation()
|
|
||||||
|
|
||||||
def get_arrow(s, denom):
|
def get_arrow(s, denom):
|
||||||
arrow = arrow_template.copy()
|
arrow = arrow_template.copy()
|
||||||
|
|
|
@ -96,7 +96,6 @@ class Histogram(Group):
|
||||||
labels = VGroup()
|
labels = VGroup()
|
||||||
for value in self.y_axis_numbers_to_show:
|
for value in self.y_axis_numbers_to_show:
|
||||||
label = Integer(value, unit="\\%")
|
label = Integer(value, unit="\\%")
|
||||||
fix_percent(label[-1][0])
|
|
||||||
label.set_height(self.y_axis_label_height)
|
label.set_height(self.y_axis_label_height)
|
||||||
label.next_to(axes.y_axis.n2p(0.01 * value), LEFT)
|
label.next_to(axes.y_axis.n2p(0.01 * value), LEFT)
|
||||||
labels.add(label)
|
labels.add(label)
|
||||||
|
@ -128,18 +127,6 @@ class Histogram(Group):
|
||||||
|
|
||||||
# Images of randomness
|
# Images of randomness
|
||||||
|
|
||||||
def fix_percent(sym):
|
|
||||||
# Really need to make this unneeded...
|
|
||||||
new_sym = sym.copy()
|
|
||||||
path_lengths = [len(path) for path in sym.get_subpaths()]
|
|
||||||
n = sum(path_lengths[:2])
|
|
||||||
p1 = sym.points[:n]
|
|
||||||
p2 = sym.points[n:]
|
|
||||||
sym.points = p1
|
|
||||||
new_sym.points = p2
|
|
||||||
sym.add(new_sym)
|
|
||||||
sym.lock_triangulation()
|
|
||||||
|
|
||||||
|
|
||||||
def get_random_process(choices, shuffle_time=2, total_time=3, change_rate=0.05,
|
def get_random_process(choices, shuffle_time=2, total_time=3, change_rate=0.05,
|
||||||
h_buff=0.1, v_buff=0.1):
|
h_buff=0.1, v_buff=0.1):
|
||||||
|
@ -238,7 +225,6 @@ def get_coin(symbol, color=None):
|
||||||
label.move_to(circ)
|
label.move_to(circ)
|
||||||
coin.add(circ, label)
|
coin.add(circ, label)
|
||||||
coin.symbol = symbol
|
coin.symbol = symbol
|
||||||
coin.lock_triangulation()
|
|
||||||
return coin
|
return coin
|
||||||
|
|
||||||
|
|
||||||
|
@ -393,7 +379,6 @@ def close_off_graph(axes, graph):
|
||||||
x_max = axes.x_axis.p2n(graph.get_end())
|
x_max = axes.x_axis.p2n(graph.get_end())
|
||||||
graph.add_line_to(axes.c2p(x_max, 0))
|
graph.add_line_to(axes.c2p(x_max, 0))
|
||||||
graph.add_line_to(axes.c2p(0, 0))
|
graph.add_line_to(axes.c2p(0, 0))
|
||||||
graph.lock_triangulation()
|
|
||||||
return graph
|
return graph
|
||||||
|
|
||||||
|
|
||||||
|
@ -403,7 +388,6 @@ def get_beta_graph(axes, n_plus, n_minus, **kwargs):
|
||||||
close_off_graph(axes, graph)
|
close_off_graph(axes, graph)
|
||||||
graph.set_stroke(BLUE, 2)
|
graph.set_stroke(BLUE, 2)
|
||||||
graph.set_fill(BLUE_E, 1)
|
graph.set_fill(BLUE_E, 1)
|
||||||
graph.lock_triangulation()
|
|
||||||
return graph
|
return graph
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ class FlipCoin(Animation):
|
||||||
def interpolate_mobject(self, alpha):
|
def interpolate_mobject(self, alpha):
|
||||||
coin = self.mobject
|
coin = self.mobject
|
||||||
for sm, start_sm in self.families:
|
for sm, start_sm in self.families:
|
||||||
sm.points[:] = start_sm.points
|
sm.match_points(start_sm)
|
||||||
coin.rotate(alpha * PI, axis=self.axis)
|
coin.rotate(alpha * PI, axis=self.axis)
|
||||||
coin.shift(4 * alpha * (1 - alpha) * self.shift_vect)
|
coin.shift(4 * alpha * (1 - alpha) * self.shift_vect)
|
||||||
return coin
|
return coin
|
||||||
|
@ -4018,9 +4018,9 @@ class FourDCubeColoringFromTrees(ThreeDScene):
|
||||||
])
|
])
|
||||||
vertex_holder.center()
|
vertex_holder.center()
|
||||||
if dim == 4:
|
if dim == 4:
|
||||||
vertex_holder.points[8:] *= 2
|
vertex_holder.get_points()[8:] *= 2
|
||||||
vertex_holder.set_width(width)
|
vertex_holder.set_width(width)
|
||||||
return vertex_holder.points
|
return vertex_holder.get_points()
|
||||||
|
|
||||||
|
|
||||||
class IntroduceHypercube(FourDCubeColoringFromTrees):
|
class IntroduceHypercube(FourDCubeColoringFromTrees):
|
||||||
|
|
|
@ -19,8 +19,8 @@ def get_baby_monster():
|
||||||
|
|
||||||
def blink_monster(monster):
|
def blink_monster(monster):
|
||||||
monster.generate_target()
|
monster.generate_target()
|
||||||
left_eye_points = monster.target[0].points[498:528]
|
left_eye_points = monster.target[0].get_points()[498:528]
|
||||||
right_eye_points = monster.target[0].points[582:612]
|
right_eye_points = monster.target[0].get_points()[582:612]
|
||||||
for points in left_eye_points, right_eye_points:
|
for points in left_eye_points, right_eye_points:
|
||||||
points[:, 1] = points[0, 1]
|
points[:, 1] = points[0, 1]
|
||||||
return MoveToTarget(monster, rate_func=squish_rate_func(there_and_back, 0.4, 0.6))
|
return MoveToTarget(monster, rate_func=squish_rate_func(there_and_back, 0.4, 0.6))
|
||||||
|
@ -63,7 +63,7 @@ def get_cube(color=BLUE_D, opacity=1, height=2, frame=None):
|
||||||
|
|
||||||
for face, p_face in zip(cube, poor_cube):
|
for face, p_face in zip(cube, poor_cube):
|
||||||
face.add(*[
|
face.add(*[
|
||||||
Line3D(p_face.points[i], p_face.points[j], width=0.02, color=GREY_B)
|
Line3D(p_face.get_points()[i], p_face.get_points()[j], width=0.02, color=GREY_B)
|
||||||
for i, j in [(0, 1), (1, 3), (3, 2), (2, 0)]
|
for i, j in [(0, 1), (1, 3), (3, 2), (2, 0)]
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -2761,7 +2761,7 @@ class AskAboutCubeDiagonals(QuadrupletShufflings):
|
||||||
for diag in diagonals:
|
for diag in diagonals:
|
||||||
globals()['diag'] = diag
|
globals()['diag'] = diag
|
||||||
Group(*[
|
Group(*[
|
||||||
cds[np.argmin([get_norm(cd.get_center() - diag.points[i]) for cd in cds])]
|
cds[np.argmin([get_norm(cd.get_center() - diag.get_points()[i]) for cd in cds])]
|
||||||
for i in [0, -1]
|
for i in [0, -1]
|
||||||
]).match_color(diag)
|
]).match_color(diag)
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ class Person(VGroup):
|
||||||
self.pop_anim(anim)
|
self.pop_anim(anim)
|
||||||
|
|
||||||
def get_center(self):
|
def get_center(self):
|
||||||
return self.center_point.points[0]
|
return self.center_point.get_points()[0]
|
||||||
|
|
||||||
|
|
||||||
class DotPerson(Person):
|
class DotPerson(Person):
|
||||||
|
@ -3050,7 +3050,6 @@ class WideSpreadTesting(Scene):
|
||||||
class VirusSpreading(Scene):
|
class VirusSpreading(Scene):
|
||||||
def construct(self):
|
def construct(self):
|
||||||
virus = SVGMobject(file_name="virus")
|
virus = SVGMobject(file_name="virus")
|
||||||
virus.lock_triangulation()
|
|
||||||
virus.set_fill(RED_E, 1)
|
virus.set_fill(RED_E, 1)
|
||||||
virus.set_stroke([RED, WHITE], width=0)
|
virus.set_stroke([RED, WHITE], width=0)
|
||||||
height = 3
|
height = 3
|
||||||
|
|
|
@ -70,10 +70,10 @@ class PiCreature(SVGMobject):
|
||||||
if self.start_corner is not None:
|
if self.start_corner is not None:
|
||||||
self.to_corner(self.start_corner)
|
self.to_corner(self.start_corner)
|
||||||
|
|
||||||
def align_data(self, mobject):
|
def align_data_and_family(self, mobject):
|
||||||
# This ensures that after a transform into a different mode,
|
# This ensures that after a transform into a different mode,
|
||||||
# the pi creatures mode will be updated appropriately
|
# the pi creatures mode will be updated appropriately
|
||||||
SVGMobject.align_data(self, mobject)
|
SVGMobject.align_data_and_family(self, mobject)
|
||||||
if isinstance(mobject, PiCreature):
|
if isinstance(mobject, PiCreature):
|
||||||
self.mode = mobject.get_mode()
|
self.mode = mobject.get_mode()
|
||||||
|
|
||||||
|
@ -139,9 +139,11 @@ class PiCreature(SVGMobject):
|
||||||
|
|
||||||
def set_color(self, color):
|
def set_color(self, color):
|
||||||
self.body.set_fill(color)
|
self.body.set_fill(color)
|
||||||
self.color = color
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
def get_color(self):
|
||||||
|
return self.body.get_color()
|
||||||
|
|
||||||
def change_mode(self, mode):
|
def change_mode(self, mode):
|
||||||
new_self = self.__class__(mode=mode)
|
new_self = self.__class__(mode=mode)
|
||||||
new_self.match_style(self)
|
new_self.match_style(self)
|
||||||
|
@ -206,7 +208,7 @@ class PiCreature(SVGMobject):
|
||||||
eye_bottom_y = eye_parts.get_y(DOWN)
|
eye_bottom_y = eye_parts.get_y(DOWN)
|
||||||
|
|
||||||
for eye_part in eye_parts.family_members_with_points():
|
for eye_part in eye_parts.family_members_with_points():
|
||||||
eye_part.points[:, 1] = eye_bottom_y
|
eye_part.get_points()[:, 1] = eye_bottom_y
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -240,9 +242,10 @@ class PiCreature(SVGMobject):
|
||||||
|
|
||||||
def shrug(self):
|
def shrug(self):
|
||||||
self.change_mode("shruggie")
|
self.change_mode("shruggie")
|
||||||
|
points = self.mouth.get_points()
|
||||||
top_mouth_point, bottom_mouth_point = [
|
top_mouth_point, bottom_mouth_point = [
|
||||||
self.mouth.points[np.argmax(self.mouth.points[:, 1])],
|
points[np.argmax(points[:, 1])],
|
||||||
self.mouth.points[np.argmin(self.mouth.points[:, 1])]
|
points[np.argmin(points[:, 1])]
|
||||||
]
|
]
|
||||||
self.look(top_mouth_point - bottom_mouth_point)
|
self.look(top_mouth_point - bottom_mouth_point)
|
||||||
return self
|
return self
|
||||||
|
|
|
@ -174,9 +174,9 @@ class Logo(VMobject):
|
||||||
])
|
])
|
||||||
for sector in new_pupil:
|
for sector in new_pupil:
|
||||||
sector.add_cubic_bezier_curve_to([
|
sector.add_cubic_bezier_curve_to([
|
||||||
sector.points[-1],
|
sector.get_points()[-1],
|
||||||
*[center] * 3,
|
*[center] * 3,
|
||||||
*[sector.points[0]] * 2
|
*[sector.get_points()[0]] * 2
|
||||||
])
|
])
|
||||||
self.remove(pupil)
|
self.remove(pupil)
|
||||||
self.add(new_pupil)
|
self.add(new_pupil)
|
||||||
|
@ -243,7 +243,7 @@ class LogoGeneration(LogoGenerationTemplate):
|
||||||
for layer in layers:
|
for layer in layers:
|
||||||
for spike in layer:
|
for spike in layer:
|
||||||
spike.save_state()
|
spike.save_state()
|
||||||
point = np.array(spike.points[0])
|
point = np.array(spike.get_points()[0])
|
||||||
angle = angle_of_vector(point)
|
angle = angle_of_vector(point)
|
||||||
spike.rotate(-angle + 90 * DEGREES)
|
spike.rotate(-angle + 90 * DEGREES)
|
||||||
spike.stretch_to_fit_width(0.2)
|
spike.stretch_to_fit_width(0.2)
|
||||||
|
@ -318,11 +318,11 @@ class SortingLogoGeneration(LogoGenerationTemplate):
|
||||||
spike.angle,
|
spike.angle,
|
||||||
about_point=ORIGIN
|
about_point=ORIGIN
|
||||||
)
|
)
|
||||||
# spike.points[1] = rotate_vector(
|
# spike.get_points()[1] = rotate_vector(
|
||||||
# spike.points[1], TAU/28,
|
# spike.get_points()[1], TAU/28,
|
||||||
# )
|
# )
|
||||||
# spike.points[-1] = rotate_vector(
|
# spike.get_points()[-1] = rotate_vector(
|
||||||
# spike.points[-1], -TAU/28,
|
# spike.get_points()[-1], -TAU/28,
|
||||||
# )
|
# )
|
||||||
|
|
||||||
def get_spike_animation(spike, **kwargs):
|
def get_spike_animation(spike, **kwargs):
|
||||||
|
|
Loading…
Add table
Reference in a new issue