diff options
Diffstat (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux')
9 files changed, 116 insertions, 238 deletions
diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md index 0af7aa1..97d6d10 100644 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md @@ -1,7 +1,5 @@ -**file1_flux_through_sphere.py** -![file1_flux_through_sphere](file1_flux_through_sphere.gif) -**file2_mobius_strip.py** -![file2_mobius_strip](file2_mobius_strip.gif) +**file1_flux_through_circle.py** +![file1_flux_through_circle](file1_flux_through_circle.gif) **file3_normal_vector.py** ![file3_normal_vector](file3_normal_vector.gif) **file4_cube_surface.py** diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_circle.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_circle.gif Binary files differnew file mode 100644 index 0000000..c00076b --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_circle.gif diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_circle.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_circle.py new file mode 100644 index 0000000..e418a96 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_circle.py @@ -0,0 +1,43 @@ +from manimlib.imports import * +def pendulum_vector_field_func(point): + #theta, omega = point[:2] + return np.array([ + point[0], + point[1], + point[2], + ]) +class F2D(Scene): + CONFIG = { + # "func": cylinder_flow_vec or_field, + "flow_time": 5, + } + def initialize_vector_field(self): + self.vector_field = VectorField( + pendulum_vector_field_func, + ) + self.vector_field.sort(get_norm) + def construct(self): + # plane = NumberPlane(color=RED) + # plane.add(plane.get_axis_labels()) + # self.add(plane) + self.initialize_vector_field() + + field = self.vector_field + c1=Circle(radius=3,color=BLUE) + self.play(ShowCreation(field), run_time=7) + self.play(ShowCreation(c1)) + self.wait(3) + lines = StreamLines( + pendulum_vector_field_func, + virtual_time=3, + min_magnitude=0, + max_magnitude=2, + ) + self.add(AnimatedStreamLines( + lines, + line_anim_class=ShowPassingFlash + )) + self.wait(2) + phase_point = VectorizedPoint(1*UP+1*RIGHT) + self.add(move_along_vector_field(phase_point, pendulum_vector_field_func)) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif Binary files differdeleted file mode 100644 index 43327bf..0000000 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif +++ /dev/null diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py deleted file mode 100644 index e07715e..0000000 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py +++ /dev/null @@ -1,50 +0,0 @@ -from manimlib.imports import * -class fluxsphere(ThreeDScene): - - - def construct(self): - s = Sphere(checkerboard_colors=[BLUE_D,BLUE_D]) - s.scale(2.3) - - n = VGroup( - *[self.n(*self.func(u, v)) - for u in np.arange(0, PI, 0.4) - for v in np.arange(0, TAU, 0.8)] - ) - - - - self.move_camera(0.8 * PI / 2, -0.45 * PI) - self.play(Write(s)) - # self.play(Write(f)) - self.play(ShowCreation(n), run_time=4) - # self.add(n) - self.begin_ambient_camera_rotation(rate=0.1) - self.wait(5) - - - def func(self, u, v): - return [ - np.cos(v) * np.sin(u), - np.sin(v) * np.sin(u), - np.cos(u) - ] - - def vect(self, x, y, z): - return np.array([ - x, y, z - ]) - - def n(self, x, y, z): - vect = np.array([ - x, - y, - z - ]) - - mag = math.sqrt(vect[0] ** 2 + vect[1] ** 2 + vect[2] ** 2) - v = Vector( - (1.5/mag) * vect, - color=RED_B, - stroke_width=4).shift(2*x * RIGHT + 2*y * UP + 2*z * OUT) - return v diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif Binary files differdeleted file mode 100644 index 9623046..0000000 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif +++ /dev/null diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py deleted file mode 100644 index 31b1990..0000000 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py +++ /dev/null @@ -1,81 +0,0 @@ -from manimlib.imports import * - -class Mobius(ThreeDScene): - def construct(self): - axes=ThreeDAxes() - - - - R=2.5 - - - mobius = ParametricSurface( - lambda u, v: np.array([ - (R+u*np.cos(v/2))*np.cos(v), - (R+u*np.cos(v/2))*np.sin( v), - u*np.sin(v/2) - ]), - u_min = -0.5, u_max = 0.5, v_min = 0, v_max = 2*PI, - - resolution=(6, 32)).fade(0.5) #Resolution of the surfaces - circle=Circle(radius=2.5, color=BLUE) - - - - mobius.rotate(PI/2, axis=RIGHT) - mobius.rotate(PI/2, axis=OUT) - # # mobius.shift(RIGHT+OUT+DOWN) - - - - - - along = ParametricSurface( - lambda u, v: np.array([ - (R+u*np.cos(v/2))*np.cos(v), - (R+u*np.cos(v/2))*np.sin(v), - 0 - ]), - u_min = -0.5, u_max = 0.5, v_min = 0, v_max = 2*PI, - - resolution=(6, 32)).fade(0.5) #Resolution of the surfaces - circle=Circle(radius=2.5, color=BLUE) - - - - - - - - - - - - - - - - - - - - - - - - self.set_camera_orientation(phi=75 * DEGREES,theta=-75*DEGREES) - - self.play(Write(mobius)) - - self.wait(1) - self.begin_ambient_camera_rotation(rate=0.65) - - self.wait(10) - self.stop_ambient_camera_rotation() - self.wait(1) - - - - - - diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif Binary files differindex c6101cf..001edb8 100644 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py index 9301a00..146d955 100644 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py @@ -1,7 +1,4 @@ from manimlib.imports import* - - - class cuber(ThreeDScene): def construct(self): @@ -41,6 +38,7 @@ class cuber(ThreeDScene): n1=TextMobject(r"$\vec{n}$",color=YELLOW) n1.scale(0.8) n1.rotate(PI/2,axis=RIGHT) + n1.rotate(PI,axis=OUT) n1.shift(3*RIGHT+1.3*OUT+DOWN) spaceloc = [[0,0,2],[1,0,2],[-1,0,2],[2,0,2],[-2,0,2],[3,0,2],[-3,0,2], @@ -59,158 +57,128 @@ class cuber(ThreeDScene): [0,3,2],[1,3,2],[-1,3,2],[2,3,2],[-2,3,2],[3,3,2],[-3,3,2]] - veclist1=[Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E)] + veclist1=[Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY)] - [veclist1[i].rotate(PI/4,axis=RIGHT) for i in range(10,30,1)] - [veclist1[i].rotate(PI/4,axis=RIGHT) for i in range(40,80,2)] - [veclist1[i].rotate(PI/6,axis=OUT) for i in range(98)] - [veclist1[i].rotate(PI/8,axis=DOWN) for i in range(98)] + [veclist1[i].rotate(PI/4,axis=RIGHT) for i in range(42)] + [veclist1[i].rotate(PI/6,axis=OUT) for i in range(42)] + [veclist1[i].rotate(PI/8,axis=DOWN) for i in range(42)] vectorfield1=VGroup(*veclist1) - [veclist1[i].shift(spaceloc[i]) for i in range(98)] + [veclist1[i].shift(spaceloc[i]) for i in range(42)] - veclist2=[Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), - Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E)] + veclist2=[Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY)] - [veclist2[i].rotate(PI/4,axis=RIGHT) for i in range(10,30,1)] - [veclist2[i].rotate(PI/4,axis=RIGHT) for i in range(40,80,2)] - [veclist2[i].rotate(PI/6,axis=OUT) for i in range(98)] - [veclist2[i].rotate(PI/8,axis=DOWN) for i in range(98)] + [veclist2[i].rotate(PI/4,axis=RIGHT) for i in range(42)] + [veclist2[i].rotate(PI/4,axis=RIGHT) for i in range(42)] + [veclist2[i].rotate(PI/6,axis=OUT) for i in range(42)] + [veclist2[i].rotate(PI/8,axis=DOWN) for i in range(42)] vectorfield2=VGroup(*veclist2) - [veclist2[i].shift(spaceloc[i]) for i in range(98)] + [veclist2[i].shift(spaceloc[i]) for i in range(42)] - veclist3=[Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector()] + veclist3=[Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY)] - [veclist3[i].rotate(PI/4,axis=RIGHT) for i in range(10,30,1)] - [veclist3[i].rotate(PI/4,axis=RIGHT) for i in range(40,80,2)] - [veclist3[i].rotate(PI/6,axis=OUT) for i in range(98)] - [veclist3[i].rotate(PI/8,axis=DOWN) for i in range(98)] + [veclist3[i].rotate(PI/4,axis=RIGHT) for i in range(42)] + [veclist3[i].rotate(PI/4,axis=RIGHT) for i in range(42)] + [veclist3[i].rotate(PI/6,axis=OUT) for i in range(42)] + [veclist3[i].rotate(PI/8,axis=DOWN) for i in range(42)] vectorfield3=VGroup(*veclist3) - [veclist3[i].shift(spaceloc[i]) for i in range(98)] + [veclist3[i].shift(spaceloc[i]) for i in range(42)] - veclist4=[Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), - Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector()] + veclist4=[Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY)] - [veclist4[i].rotate(PI/4,axis=RIGHT) for i in range(10,30,1)] - [veclist4[i].rotate(PI/4,axis=RIGHT) for i in range(40,80,2)] - [veclist4[i].rotate(PI/6,axis=OUT) for i in range(98)] - [veclist4[i].rotate(PI/8,axis=DOWN) for i in range(98)] + [veclist4[i].rotate(PI/4,axis=RIGHT) for i in range(42)] + [veclist4[i].rotate(PI/4,axis=RIGHT) for i in range(42)] + [veclist4[i].rotate(PI/6,axis=OUT) for i in range(42)] + [veclist4[i].rotate(PI/8,axis=DOWN) for i in range(42)] vectorfield4=VGroup(*veclist4) - [veclist4[i].shift(spaceloc[i]) for i in range(98)] + [veclist4[i].shift(spaceloc[i]) for i in range(42)] vectorfield1.shift(1.5*DOWN) vectorfield2.shift(IN+1.5*DOWN) vectorfield3.shift(2*IN+1.5*DOWN) - vectorfield4.shift(3*IN+1.5*DOWN) + vectorfield4.shift(3*IN+1.5*DOWN) + vectors=[vectorfield1,vectorfield2,vectorfield3,vectorfield4] vectorfield=VGroup(*vectors) - vectorfield.scale(1.25) + vectorfield.scale(1.3) + - fv=[Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE), - Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE), - Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE), - Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE), + fv=[Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY),Vector(color=GREY),Vector(color=GREY),Vector(color=GREY), + Vector(color=GREY) ] - spaceloc2 = [[1.5,0.5,0.5],[1.5,1,0.5],[1.5,1.5,0.5],[1.5,2,0.5], - [1.5,0.5,1],[1.5,1,1],[1.5,1.5,1],[1.5,2,1], - [1.5,0.5,1.5],[1.5,1,1.5],[1.5,1.5,1.5],[1.5,2,1.5], - [1.5,0.5,2],[1.5,1,2],[1.5,1.5,2],[1.5,2,2]] - - [fv[i].rotate(PI/4,axis=RIGHT) for i in range(1)] - [fv[i].rotate(PI/6,axis=OUT) for i in range(16)] - [fv[i].rotate(PI/8,axis=DOWN) for i in range(16)] - [fv[i].shift(spaceloc2[i]) for i in range(16)] + spaceloc2 = [[1.5,0.5,0.5],[1.5,1,0.5],[1.5,1.5,0.5], + [1.5,0.5,1],[1.5,1,1],[1.5,1.5,1], + [1.5,0.5,1.5],[1.5,1,1.5],[1.5,1.5,1.5] + ] + [fv[i].rotate(PI/4,axis=RIGHT) for i in range(9)] + [fv[i].rotate(PI/6,axis=OUT) for i in range(9)] + [fv[i].rotate(PI/8,axis=DOWN) for i in range(9)] + [fv[i].shift(spaceloc2[i]) for i in range(9)] fvfield=VGroup(*fv) - fvfield.shift(0.5*IN+2*DOWN) + fvfield.shift(2*DOWN) + fvfield.scale(1.3) - flux=TextMobject("Flux through one side of the cube").set_color(ORANGE) - flux.shift(3*UP+1.5*LEFT) + flux=TextMobject("Flux through one side of the cube").set_color(GOLD) + flux.shift(3.5*UP+0.5*LEFT) + alll=[vectorfield1,vectorfield2,vectorfield3,vectorfield4,fvfield] + alllvectors=VGroup(*alll) self.set_camera_orientation(phi=70 * DEGREES,theta=-75*DEGREES) self.play(ShowCreation(axes),ShowCreation(axis_label)) - self.play(ShowCreation(vectorfield)) - self.add(fvfield) - self.begin_ambient_camera_rotation(rate=0.01) + self.begin_ambient_camera_rotation(rate=0.2) + self.play(ShowCreation(alllvectors)) + # self.add(fvfield) self.play(ShowCreation(cube, run_time=1)) @@ -223,6 +191,6 @@ class cuber(ThreeDScene): # self.play(ShowCreation(flux)) self.wait(1) self.play(ShowCreation(v1),ShowCreation(n1)) - self.wait(6) - # self.stop_ambient_camera_rotation() - + self.wait(5) + self.stop_ambient_camera_rotation() + self.wait(1) |