Skip to content

Commit

Permalink
added more points and added movealong path point at infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
martawleklinska committed Jun 26, 2024
1 parent 8fba6ce commit 8d198c1
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 19 deletions.
Binary file modified data/sound/short1/slide1-0.mp3
Binary file not shown.
Binary file modified data/sound/short1/slide2-0.mp3
Binary file not shown.
Binary file modified data/sound/short1/slide2-1.mp3
Binary file not shown.
Binary file modified data/sound/short1/slide2-2.mp3
Binary file not shown.
Binary file modified data/sound/short1/slide2-3.mp3
Binary file not shown.
Binary file removed data/sound/short1/slide2-4.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion zkmarek/video/slides/short1/challange.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def construct(self):
def animate_in(self, scene):
self.new_subsection(scene, "challange", "data/sound/short1/slide1-0.mp3")
scene.play(FadeIn(self.title), FadeIn(self.image), run_time=0.7)
scene.wait(3.5)
scene.wait(4.5)

def animate_out(self, scene):
scene.play(FadeOut(self.title), FadeOut(self.image), run_time=0.5)
54 changes: 36 additions & 18 deletions zkmarek/video/slides/short1/short.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
Dot,
Circle,
VGroup,
Create,
Flash,
FadeTransform,
VMobject,
MoveAlongPath,
Expand Down Expand Up @@ -130,6 +128,10 @@ def create_plane_and_curves(self):
)
self.path = VMobject()
self.path.set_points_smoothly(np.array(self.plane_curve_points_positive))
self.path1 = VMobject()
self.path1.set_points_smoothly(
np.array(reversed(self.plane_curve_points_negative))
)

def animate_in(self, scene):
self.new_subsection(
Expand All @@ -146,12 +148,15 @@ def animate_in(self, scene):

dot = Dot(color=PRIMARY_COLOR)
scene.add(dot)
scene.play(MoveAlongPath(dot, self.path), run_time=4)
scene.play(MoveAlongPath(dot, self.path), run_time=3)
scene.play(MoveAlongPath(dot, self.path1), run_time=2)
dot1 = Text("?", font_size=15, font=PRIMARY_FONT, color=PRIMARY_COLOR)
scene.play(FadeTransform(dot, dot1))

self.new_subsection(
scene, "projective coordinates", "data/sound/short1/slide2-1.mp3"
)
scene.play(FadeOut(dot))
scene.play(FadeOut(dot1))
self.animate_wrapping(scene)
scene.play(FadeTransform(self.plane, self.sphere_ec), run_time=0.5)

Expand All @@ -160,20 +165,17 @@ def animate_in(self, scene):
scene.move_camera(phi=15 * DEGREES, theta=90 * DEGREES, run_time=2)
scene.begin_ambient_camera_rotation(rate=0.1)

self.new_subsection(scene, "south pole", "data/sound/short1/slide2-2.mp3")
self.new_subsection(scene, "north pole", "data/sound/short1/slide2-2.mp3")

self.x_values = [0.1, 0.2, 0.6, 1, 2, 4]
self.x_values = [0.1, 0.2, 0.6]
colors = np.array(
[
SECONDARY_COLOR,
HIGHLIGHT_COLOR,
PRIMARY_COLOR,
]
)
for i in range(len(self.x_values)):
colors = np.array(
[
SECONDARY_COLOR,
HIGHLIGHT_COLOR,
PRIMARY_COLOR,
SECONDARY_COLOR,
HIGHLIGHT_COLOR,
PRIMARY_COLOR,
]
)
point = self.elliptic_curve_points(self.x_values[i])
if point is not None:
projected_point = self.stereographic_projection(point[0], point[1])
Expand All @@ -184,9 +186,25 @@ def animate_in(self, scene):
font=PRIMARY_FONT,
font_size=15,
).next_to(dot, RIGHT)
label.rotate(-scene.camera.get_phi() - 90 * DEGREES, axis=[0, 0, 1])
label.rotate(-scene.camera.get_phi(), axis=[0, 0, 1])
scene.add(dot, label)
scene.move_camera(phi=60 * DEGREES, theta=45 * DEGREES, run_time=3.5)
self.new_subsection(scene, "south pole", "data/sound/short1/slide2-3.mp3")
self.x_values = [1, 2, 4]
for i in range(len(self.x_values)):
point = self.elliptic_curve_points(self.x_values[i])
if point is not None:
projected_point = self.stereographic_projection(point[0], point[1])
dot = Dot(point=projected_point, color=colors[i])
label = Text(
f"({point[0]:.1f},{point[1]:.1f})",
color=colors[i],
font=PRIMARY_FONT,
font_size=15,
).next_to(dot, RIGHT)
label.rotate(-scene.camera.get_phi(), axis=[0, 0, 1])
scene.add(dot, label)
scene.move_camera(phi=100 * DEGREES, theta=45 * DEGREES, run_time=3.5)

scene.play(
FadeIn(self.equatorial_plane),
Expand Down Expand Up @@ -235,7 +253,7 @@ def animate_wrapping(self, scene):
animations.append(Transform(line, self.new_line.set_color(PRIMARY_COLOR)))

scene.play(*fade_in_animations)
scene.play(*animations, run_time=4)
scene.play(*animations, run_time=5)

def animate_out(self, scene):
scene.play(
Expand Down

0 comments on commit 8d198c1

Please sign in to comment.