summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py
diff options
context:
space:
mode:
authorPurusharth Saxena2020-06-23 17:10:19 +0530
committerGitHub2020-06-23 17:10:19 +0530
commit959329ed76fb5350f5f68aeb8937a37b62138890 (patch)
treee6fd874de58f65329b0601792cab0a7ddeb0a1b9 /FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py
parentc6da725924409e6a92cff4f51d6ce17ce256b078 (diff)
parent5a80fc01354cb1ed46a42a3e67126a6f966cf4cc (diff)
downloadFSF-mathematics-python-code-archive-959329ed76fb5350f5f68aeb8937a37b62138890.tar.gz
FSF-mathematics-python-code-archive-959329ed76fb5350f5f68aeb8937a37b62138890.tar.bz2
FSF-mathematics-python-code-archive-959329ed76fb5350f5f68aeb8937a37b62138890.zip
Merge pull request #36 from saarthdeshpande/master
post-review updates
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)