summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file1_missile-example.py
diff options
context:
space:
mode:
authorVaishnavi2020-06-24 04:34:04 +0530
committerGitHub2020-06-24 04:34:04 +0530
commit1e9bdf332754d334c03d5486635d74cd613ce7bc (patch)
tree62baa0d776b4d7f480db5c4cf7508a7d173f80bc /FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file1_missile-example.py
parent581ad7f906e4b9a13d5fe963229d458f0abff7f2 (diff)
parented86b5f6d84efe35cea6b63b4f7d6afce8cde4b7 (diff)
downloadFSF-mathematics-python-code-archive-1e9bdf332754d334c03d5486635d74cd613ce7bc.tar.gz
FSF-mathematics-python-code-archive-1e9bdf332754d334c03d5486635d74cd613ce7bc.tar.bz2
FSF-mathematics-python-code-archive-1e9bdf332754d334c03d5486635d74cd613ce7bc.zip
Merge pull request #1 from FOSSEE/master
update fork. DONE
Diffstat (limited to 'FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file1_missile-example.py')
-rw-r--r--FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file1_missile-example.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file1_missile-example.py b/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file1_missile-example.py
new file mode 100644
index 0000000..cd754cd
--- /dev/null
+++ b/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file1_missile-example.py
@@ -0,0 +1,37 @@
+from manimlib.imports import *
+import numpy as np
+
+
+def function(coordinate):
+ x,y = coordinate[:2]
+ return np.array([
+ np.sin(x-y),
+ np.exp(y),
+ 0
+ ])
+def func(coordinate):
+ x,y = coordinate[:2]
+ return np.array([
+ -2*x,
+ y,
+ 0])
+
+class Missiles(GraphScene):
+ def construct(self):
+
+ field = VectorField(function)
+ #path = ParametricFunction(lambda x: -2*x)
+
+ dot = SVGMobject("miss").move_to(DL).scale(0.09).set_color(WHITE).rotate(PI/4 + PI)
+ path = ArcBetweenPoints(dot.get_center(), UP+0.2*LEFT)
+
+ self.play(FadeIn(field))
+ self.wait()
+ self.play(FadeIn(dot))
+ self.wait()
+ self.play(MoveAlongPath(dot, path))
+ self.play(ApplyMethod(dot.rotate, PI/4), rate = 0.2)
+ self.play(ApplyMethod(dot.move_to, 3.5*UP), rate = 0.3)
+ #self.play(ApplyMethod(dot.move_to, 3.5*UP))
+ #self.add_fixed_in_frame_mobjects(text_field)
+ self.wait() \ No newline at end of file