summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.py
blob: 67c675edd49b1d618593d111995c1970a915ed68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from manimlib.imports import *

class tangent(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        self.set_camera_orientation(phi = 125*DEGREES, theta = 135*DEGREES)
        h = ParametricFunction(
            lambda t: np.array([
                4*(t**3) + 5,
                t**2 + 2*(t**4),
                -2*np.log(2*t)
            ]), t_min = -3, t_max = 1.18
        ).shift(5*LEFT)
        tgtR = Line((4,3,-2*np.log(2)), (19.5, 16, -4.772588), color=YELLOW)
        tgtL =Line((4,3,-2*np.log(2)), (-11.5, -10, 2), color=YELLOW)
        dot = Dot((4,3,-2*np.log(2)), color=RED, radius=0.08)
        self.play(FadeIn(axes),FadeIn(h), FadeIn(dot))
        self.begin_ambient_camera_rotation(rate=0.4)
        self.wait(2)
        self.play(FadeIn(tgtL), FadeIn(tgtR))
        self.wait(5)
        self.play(FadeOut(axes), FadeOut(h), FadeOut(dot), FadeOut(tgtL), FadeOut(tgtR))