summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.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/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.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/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py')
-rw-r--r--FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py
new file mode 100644
index 0000000..baf08b1
--- /dev/null
+++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py
@@ -0,0 +1,42 @@
+from manimlib.imports import *
+
+class Sphere(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes() # creates a 3D Axis
+
+ sphere = ParametricSurface(
+ lambda u, v: np.array([
+ np.sin(u)*np.cos(v),
+ np.sin(u)*np.sin(v),
+ np.cos(u)
+ ]),u_min=0,u_max=PI,v_min=0,v_max=2*PI,checkerboard_colors=[RED_D, RED_E],
+ resolution=(15, 32)).scale(2)
+
+
+
+ #self.set_camera_orientation(phi=0 * DEGREES,theta=270*DEGREES)
+
+ text3d = TextMobject(r"$f(x,y) \rightarrow Point(x,y,z)$")
+ text3d1 = TextMobject(r"$f(x,y) \rightarrow Point(x,y, 1 - x^2 - y^2)$")
+ self.add_fixed_in_frame_mobjects(text3d)
+ text3d.scale(0.7)
+ text3d1.scale(0.7)
+ text3d.to_corner(UL)
+ text3d1.to_corner(UL)
+ text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+ text3d1.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+ self.play(Write(text3d))
+ self.wait(1)
+
+ self.play(Transform(text3d,text3d1))
+ self.add_fixed_in_frame_mobjects(text3d1)
+ self.play(FadeOut(text3d))
+
+
+ self.set_camera_orientation(phi=75 * DEGREES)
+ self.begin_ambient_camera_rotation(rate=0.3)
+
+
+ self.add(axes)
+ self.play(Write(sphere))
+ self.wait(5) \ No newline at end of file