summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/Curl and Div/DivCurl_file6_macro-micro-curl.py
diff options
context:
space:
mode:
authorVaishnavi2020-07-28 00:54:56 +0530
committerGitHub2020-07-28 00:54:56 +0530
commit5b07b9ea49918b80f6f17796071de86ba30ec46c (patch)
treecd21ca0431f4c170387110f1e957d42ecd197ae2 /FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/Curl and Div/DivCurl_file6_macro-micro-curl.py
parent1cddd7b803966ec1adb7043d65bf4964994543c7 (diff)
parent15fc46198f69a6563b0348491efdf88a2dca3ef7 (diff)
downloadFSF-mathematics-python-code-archive-5b07b9ea49918b80f6f17796071de86ba30ec46c.tar.gz
FSF-mathematics-python-code-archive-5b07b9ea49918b80f6f17796071de86ba30ec46c.tar.bz2
FSF-mathematics-python-code-archive-5b07b9ea49918b80f6f17796071de86ba30ec46c.zip
Merge pull request #7 from FOSSEE/master
Update fork repo. DONE
Diffstat (limited to 'FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/Curl and Div/DivCurl_file6_macro-micro-curl.py')
-rw-r--r--FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/Curl and Div/DivCurl_file6_macro-micro-curl.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/Curl and Div/DivCurl_file6_macro-micro-curl.py b/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/Curl and Div/DivCurl_file6_macro-micro-curl.py
new file mode 100644
index 0000000..02c75a3
--- /dev/null
+++ b/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/Curl and Div/DivCurl_file6_macro-micro-curl.py
@@ -0,0 +1,42 @@
+from manimlib.imports import *
+import numpy as np
+
+def curl(coordinate):
+ x,y = coordinate[:2]
+ return np.array([
+ -y,
+ x,
+ 0
+ ])
+
+
+class Subtle(Scene):
+ def construct(self):
+ vf1 = VectorField(curl)
+ pinwheel = SVGMobject("geo").move_to(np.array([2, 0, 0])).scale(0.3).set_stroke(width = 0.3).set_color_by_gradient(["#adf802", YELLOW_C]).move_to(np.array([2.3, 0, 0]))
+ self.add(pinwheel)
+
+ label1 = TexMobject(r"\textit{Microscopic curl}").shift(3*DOWN).add_background_rectangle()
+ label2 = TexMobject(r"\textit{Macroscopic curl}").shift(3*DOWN)
+
+ ball1 = Dot(checkerboard_colors = [BLUE_E, PURPLE_E], resolution = [2,2], radius = 0.4).move_to(np.array([-1, -1, 0]))
+ ball2 = Sphere(checkerboard_colors = [BLUE_E, TEAL], resolution = [16, 16], radius = 0.3).move_to(np.array([2, 0, 0]))
+ circ = Circle(radius = 2)
+
+
+ self.add(vf1)
+ self.wait()
+ self.play(ShowCreation(pinwheel))
+ self.bring_to_front(pinwheel)
+ self.play(Rotating(pinwheel), ShowCreation(label1))
+ self.wait(2)
+ #self.add(ball1)
+ move_submobjects_along_vector_field(pinwheel, curl)
+ self.play(FadeOut(label1), ShowCreation(label2))
+ self.play(Indicate(label2))
+
+ self.wait(5)
+
+
+
+