mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 17:29:06 +08:00
Random cleanups to eoc
This commit is contained in:
@ -1659,6 +1659,8 @@ class OneOverX(PiCreatureScene, GraphScene):
|
||||
self.y_max = self.y_axis_height/self.unit_length
|
||||
|
||||
def construct(self):
|
||||
self.force_skipping()
|
||||
|
||||
self.introduce_function()
|
||||
self.introduce_puddle()
|
||||
self.introduce_graph()
|
||||
@ -1704,7 +1706,7 @@ class OneOverX(PiCreatureScene, GraphScene):
|
||||
run_time = 2
|
||||
)
|
||||
self.dither()
|
||||
self.play(*self.get_bubble_fade_anims())
|
||||
self.play(RemovePiCreatureBubble(self.pi_creature))
|
||||
|
||||
def introduce_puddle(self):
|
||||
rect_group = self.get_rectangle_group(self.start_x_value)
|
||||
@ -1805,8 +1807,16 @@ class OneOverX(PiCreatureScene, GraphScene):
|
||||
df_brace = Brace(h_lines, RIGHT, buff = 0)
|
||||
df_label = df_brace.get_text("$d\\left(\\frac{1}{x}\\right)$")
|
||||
df_brace.add(df_label)
|
||||
minus_sign = TexMobject("-")
|
||||
minus_sign.move_to(df_label, LEFT)
|
||||
|
||||
negative = TextMobject("Negative")
|
||||
negative.highlight(RED)
|
||||
negative.next_to(df_label, UP+RIGHT)
|
||||
negative.shift(RIGHT)
|
||||
negative_arrow = Arrow(
|
||||
negative.get_left(),
|
||||
df_label.get_corner(UP+RIGHT),
|
||||
color = RED
|
||||
)
|
||||
|
||||
area_changes = VGroup()
|
||||
point_pairs = [
|
||||
@ -1888,9 +1898,10 @@ class OneOverX(PiCreatureScene, GraphScene):
|
||||
ShowCreation(area_lost_arrow)
|
||||
)
|
||||
self.dither()
|
||||
self.revert_to_original_skipping_status()###
|
||||
self.play(
|
||||
Write(minus_sign),
|
||||
df_label.next_to, minus_sign, RIGHT, SMALL_BUFF
|
||||
Write(negative),
|
||||
ShowCreation(negative_arrow)
|
||||
)
|
||||
self.dither()
|
||||
self.play(
|
||||
|
3118
eoc/chapter4.py
3118
eoc/chapter4.py
File diff suppressed because it is too large
Load Diff
3230
eoc/chapter5.py
3230
eoc/chapter5.py
File diff suppressed because it is too large
Load Diff
70
eoc/chapter9.py
Normal file
70
eoc/chapter9.py
Normal file
@ -0,0 +1,70 @@
|
||||
from helpers import *
|
||||
import scipy
|
||||
|
||||
from mobject.tex_mobject import TexMobject
|
||||
from mobject import Mobject
|
||||
from mobject.image_mobject import ImageMobject
|
||||
from mobject.vectorized_mobject import *
|
||||
|
||||
from animation.animation import Animation
|
||||
from animation.transform import *
|
||||
from animation.simple_animations import *
|
||||
from animation.playground import *
|
||||
from topics.geometry import *
|
||||
from topics.characters import *
|
||||
from topics.functions import *
|
||||
from topics.fractals import *
|
||||
from topics.number_line import *
|
||||
from topics.combinatorics import *
|
||||
from topics.numerals import *
|
||||
from topics.three_dimensions import *
|
||||
from topics.objects import *
|
||||
from scene import Scene
|
||||
from scene.zoomed_scene import ZoomedScene
|
||||
from scene.reconfigurable_scene import ReconfigurableScene
|
||||
from camera import Camera
|
||||
from mobject.svg_mobject import *
|
||||
from mobject.tex_mobject import *
|
||||
|
||||
from eoc.graph_scene import GraphScene
|
||||
from eoc.chapter1 import Thumbnail as Chapter1Thumbnail
|
||||
from topics.common_scenes import OpeningQuote, PatreonThanks
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -76,7 +76,7 @@ class ThreeDCamera(CameraWithPerspective):
|
||||
three_d_status = map(is_3d, vmobs)
|
||||
has_points = [vm.get_num_points() > 0 for vm in vmobs]
|
||||
if all(three_d_status) and all(has_points):
|
||||
cmp_vect = self.get_unit_normal_vect(vm)
|
||||
cmp_vect = self.get_unit_normal_vect(vmobs[1])
|
||||
return cmp(*[
|
||||
np.dot(vm.get_center(), cmp_vect)
|
||||
for vm in vmobs
|
||||
@ -98,8 +98,8 @@ def is_3d(mobject):
|
||||
return hasattr(mobject, "part_of_3d_mobject")
|
||||
|
||||
class ThreeDMobject(VMobject):
|
||||
def __init__(self, **kwargs):
|
||||
VMobject.__init__(self, **kwargs)
|
||||
def __init__(self, *args, **kwargs):
|
||||
VMobject.__init__(self, *args, **kwargs)
|
||||
for submobject in self.submobject_family():
|
||||
submobject.part_of_3d_mobject = True
|
||||
|
||||
|
Reference in New Issue
Block a user