summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file4_continuity_func.py
blob: 551c8a8125381ccc4078633c99ace85ee1d05bf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from manimlib.imports import *

class ContinuityFunc(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes() 

        text3d = TextMobject(r"$f(x,y) = \frac{3x^2y}{x^2 + y^2}$")
        self.add_fixed_in_frame_mobjects(text3d)
       
        text3d.to_corner(UL)
      
        text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)

        self.play(Write(text3d))
        self.wait(1)

        continuity_func = ParametricSurface(
            lambda u, v: np.array([
                u*np.cos(v),
                u*np.sin(v),
                3*u*np.cos(v)*np.cos(v)*np.sin(v)
            ]),u_min=-1.5,u_max=1.5,v_min=0,v_max=2*PI,checkerboard_colors=[YELLOW_C, YELLOW_E],
            resolution=(15, 32)).scale(2)

    

        self.set_camera_orientation(phi=80 * DEGREES)
        self.begin_ambient_camera_rotation(rate=0.3)

        self.add(axes)
        self.play(Write(continuity_func))
        self.wait(8)