summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.py
blob: eddd3fee5344865fc1be278820e614a9662e28d7 (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
from manimlib.imports import *

class helix_(ThreeDScene):
    CONFIG = {
    "x_min": -6,
    "x_max": 6,
    "y_min": -6,
    "y_max": 6,
    "graph_origin": ORIGIN
    }
    def construct(self):
        axes = ThreeDAxes()
        helix = ParametricFunction(
            lambda t: np.array([
                1.5*np.cos(TAU*t),
                1.5*np.sin(TAU*t),
                2*t
            ]), t_min = -1, t_max = 2, color = RED
        )
        cylinder = ParametricSurface(
        lambda u, v: np.array([
        1.5*np.cos(TAU*v),
        1.5*np.sin(TAU*v),
        2*u
        ]), u_min = -1, u_max = 2, fill_opacity = -.4, fill_color = WHITE, color = WHITE
        )
        self.set_camera_orientation(phi=60* DEGREES,theta=45*DEGREES)
        self.play(FadeIn(axes), FadeIn(cylinder), ShowCreation(helix, run_time = 4))
        self.begin_ambient_camera_rotation(rate=0.5)
        self.wait(5)
        self.play(FadeOut(axes),FadeOut(helix), FadeOut(cylinder))