From 93971fcabe8b15fbb124947c8322df4c3151a4a7 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:15:39 +0530 Subject: Create file1_flux_through_sphere.py --- .../flux/file1_flux_through_sphere.py | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') 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 new file mode 100644 index 0000000..e07715e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py @@ -0,0 +1,50 @@ +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 -- cgit From 510a0387a035d5b9d8908c6db2dbf531568f1b6e Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:17:16 +0530 Subject: Add files via upload --- .../flux/file1_flux_through_sphere.gif | Bin 0 -> 7695314 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') 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 new file mode 100644 index 0000000..43327bf Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif differ -- cgit From 52e633214992ecf0145815d8518e1acf5028c2de Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:19:53 +0530 Subject: Create file2_mobius_strip.py --- .../flux/file2_mobius_strip.py | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') 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 new file mode 100644 index 0000000..31b1990 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py @@ -0,0 +1,81 @@ +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) + + + + + + -- cgit From 0d0ad18b69f002d27e34e90da4be1e80577d4293 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:23:08 +0530 Subject: Add files via upload --- .../flux/file2_mobius_strip.gif | Bin 0 -> 20725583 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') 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 new file mode 100644 index 0000000..9623046 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif differ -- cgit From 8fbe4b485ce66790ba0e9e470617825e312cfea3 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:25:09 +0530 Subject: Create file3_normal_vector.py --- .../flux/file3_normal_vector.py | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.py (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.py new file mode 100644 index 0000000..a959210 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.py @@ -0,0 +1,47 @@ +from manimlib.imports import * +class S(ThreeDScene): + def construct(self): + axes=ThreeDAxes() + + sphere=Sphere(radius=2,checkerboard_colors=[BLUE_C,BLUE_B],fill_opacity=0.75) + + + v1=Vector(color=YELLOW,buff=5) + v1.rotate(PI/4,axis=DOWN) + v1.shift(1.5*RIGHT+1.5*OUT) + + v2=Vector(color=RED,buff=5) + v2.rotate(PI/4,axis=DOWN) + v2.rotate(PI,axis=DOWN) + v2.shift(0.77*RIGHT+0.77*OUT) + + + + + n1=TextMobject(r"$\vec{n}$",color=YELLOW) + n2=TextMobject(r"$-\vec{n}$",color= RED) + n1.rotate(PI/2,axis=RIGHT) + n1.shift(2*RIGHT+2*OUT) + n2.rotate(PI/2,axis=RIGHT) + n2.shift(0.42*RIGHT+0.42*OUT) + + + + self.set_camera_orientation(phi=75 * DEGREES,theta=-45*DEGREES) + # self.add(mobius) + # self.play(ShowCreation(axes)) + self.play(ShowCreation(axes)) + # self.play(ShowCreation(vg)) + self.play(ShowCreation(sphere)) + self.wait(0.7) + self.play(ShowCreation(v1, run_time=2)) + self.play(ShowCreation(n1)) + self.wait(1) + self.begin_ambient_camera_rotation(rate=0.65) + self.wait(2) + self.play(ShowCreation(v2, run_time=3)) + self.wait(3) + self.play(ShowCreation(n2)) + + self.stop_ambient_camera_rotation() + self.wait(1.2) -- cgit From 89ea1c747bacfc073a052c36081bd1d2f2f0c199 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:28:59 +0530 Subject: Add files via upload --- .../flux/file3_normal_vector.gif | Bin 0 -> 24776215 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.gif (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.gif new file mode 100644 index 0000000..a8f2990 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.gif differ -- cgit From 24a759834626921654aba1fbae74c70e3a3d7b1c Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:30:10 +0530 Subject: Add files via upload --- .../flux/file4_cube_surface.gif | Bin 0 -> 3620201 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') 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 new file mode 100644 index 0000000..c6101cf Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif differ -- cgit From 7f39c6fcf7990fafe53fe2aeb2c2f7bfd429b970 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:30:58 +0530 Subject: Create file4_cube_surface.py --- .../flux/file4_cube_surface.py | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') 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 new file mode 100644 index 0000000..5963996 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py @@ -0,0 +1,71 @@ +from manimlib.imports import* + + + +class cuber(ThreeDScene): + def construct(self): + + axes=ThreeDAxes() + cube=Cube() + # cube.scale(1) + cube.shift(RIGHT+DOWN+OUT) + + + + sq3=Square(color=RED, fill_opacity=0.85) + sq3.rotate(PI/2, axis=UP) + sq3.shift(DOWN+OUT+2*RIGHT) + + x=TextMobject("x") + y=TextMobject("y") + z=TextMobject("z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + v1=Vector(color=YELLOW,buff=15) + v1.rotate(PI/4,axis=RIGHT) + v1.shift(2*RIGHT+1*DOWN+1*OUT) + + + n1=TextMobject(r"$\vec{n}$",color=YELLOW) + n1.scale(0.8) + n1.rotate(PI/2,axis=RIGHT) + n1.shift(3*RIGHT+1.3*OUT+DOWN) + + + + self.set_camera_orientation(phi=75 * DEGREES,theta=-15*DEGREES) + self.play(ShowCreation(axes),ShowCreation(axis_label)) + self.play(ShowCreation(cube, run_time=3)) + self.begin_ambient_camera_rotation(rate=-0.2) + # self.move_camera(phi=150*DEGREES,theta=-45*DEGREES, run_time=3) + self.wait(1) + self.play(ShowCreation(sq3)) + + self.wait(1) + self.play(ShowCreation(v1),ShowCreation(n1)) + self.wait(1) + self.stop_ambient_camera_rotation() + self.wait(2) + + + # self.play(Write(t1)) + # self.play(Transform(vg,t1)) + # self.wait(3) + # self.play(ReplacementTransform(t1,t2)) + # self.wait(3) + # # self.move_camera(phi=50*DEGREES,theta=-45*DEGREES,run_time=3) + # self.wait(8) + # self.move_camera(phi=75 * DEGREES, run_time=3) + # self.wait(3) -- cgit From a896e8b74b1b4864f24d860ea82e4de46d2ff2c7 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 12:05:35 +0530 Subject: Create README.md --- .../triple-and-surface-integrals/flux/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md (limited to 'FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux') 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 new file mode 100644 index 0000000..0af7aa1 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md @@ -0,0 +1,8 @@ +**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) +**file3_normal_vector.py** +![file3_normal_vector](file3_normal_vector.gif) +**file4_cube_surface.py** +![file4_cube_surface](file4_cube_surface.gif) -- cgit