summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.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/geometry-of-planes-and-curves/space-curves/file4_cone.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/geometry-of-planes-and-curves/space-curves/file4_cone.py')
-rw-r--r--FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py
new file mode 100644
index 0000000..e6ae1c6
--- /dev/null
+++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py
@@ -0,0 +1,33 @@
+from manimlib.imports import *
+
+class cone(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes()
+ eqn = TextMobject(r'$z^{2} = x^{2} + y^{2}$')
+
+ conecurve = ParametricFunction(
+ lambda t: np.array([
+ t*np.cos(TAU*t),
+ t*np.sin(TAU*t),
+ t
+ ]), t_min = -2.6, t_max = 2.6
+ ).scale(0.85)
+
+ conesurface = ParametricSurface(
+ lambda u,v: np.array([
+ 3*np.sin(u)*np.cos(TAU*v),
+ 3*np.sin(u)*np.sin(TAU*v),
+ 2.7*u
+ ]), u_min = -1
+ ).scale(0.85)
+
+ self.play(FadeIn(eqn))
+ self.wait(2)
+ self.play(FadeOut(eqn))
+ self.set_camera_orientation(phi = 75*DEGREES, theta=50*DEGREES)
+ self.play(FadeIn(axes), ShowCreation(conecurve, run_time = 3))
+ self.play(FadeOut(conecurve), FadeIn(conesurface))
+ self.begin_ambient_camera_rotation(rate=0.03)
+ self.wait(2)
+ self.play(FadeOut(axes), FadeOut(conesurface))
+ self.wait(2)