示例#1
0
    def __init__(self, **kwargs):

        VGroup.__init__(self, **kwargs)
        self.color_list = color_gradient(self.colors, self.layer_num)
        self.add(
            Dot(color=average_color(self.colors[0], WHITE),
                plot_depth=4).set_height(0.015 * self.radius))
        for i in range(self.layer_num):
            # self.add(Arc(radius= self.radius/self.layer_num * (0.5 + i), angle=TAU, color=self.color_list[i],
            #              stroke_width=100 * self.radius/self.layer_num,
            #              stroke_opacity=self.opacity_func(i/self.layer_num), plot_depth=5))
            self.add(
                Arc(radius=self.radius * self.rate_func(
                    (0.5 + i) / self.layer_num),
                    angle=TAU,
                    color=self.color_list[i],
                    stroke_width=101 *
                    (self.rate_func((i + 1) / self.layer_num) -
                     self.rate_func(i / self.layer_num)) * self.radius,
                    stroke_opacity=self.opacity_func(
                        self.rate_func(i / self.layer_num)),
                    plot_depth=5))
示例#2
0
    def scatter(self,
                x,
                y,
                size=None,
                color=None,
                fill_opacity=None,
                stroke_width=None,
                **kwargs):
        if color is None:
            color = it.cycle([next(self.default_graph_colors_cycle)])
        else:
            if is_sequence(color):
                color = it.cycle(color)
            else:
                color = it.cycle([color])
        if size is None:
            size = self.default_dot_radius
        if fill_opacity is None:
            fill_opacity = self.default_dot_opacity
        if stroke_width is None:
            stroke_width = self.default_dot_stroke_width

        scatter_sequence = VGroup()
        for i in range(len(y)):
            point = self.coords_to_point(x[i], y[i])
            dot = Dot(
                color=next(color),
                radius=size,
                fill_opacity=fill_opacity,
                stroke_width=stroke_width,
                **kwargs,
            ).move_to(point)
            scatter_sequence.add(dot)
        if hasattr(self, "scatter_sequences") is False:
            self.scatter_sequences = VGroup()
        self.scatter_sequences.add(scatter_sequence)
        self.add(self.scatter_sequences)
        return scatter_sequence
示例#3
0
    def show_ghost_movement(self, vector):
        if isinstance(vector, Arrow):
            vector = vector.get_end() - vector.get_start()
        elif len(vector) == 2:
            vector = np.append(np.array(vector), 0.0)
        x_max = int(FRAME_X_RADIUS + abs(vector[0]))
        y_max = int(FRAME_Y_RADIUS + abs(vector[1]))
        dots = VMobject(*[
            Dot(x * RIGHT + y * UP)
            for x in range(-x_max, x_max)
            for y in range(-y_max, y_max)
        ])
        dots.set_fill(BLACK, opacity=0)
        dots_halfway = dots.copy().shift(vector / 2).set_fill(WHITE, 1)
        dots_end = dots.copy().shift(vector)

        self.play(Transform(
            dots, dots_halfway, rate_func=rush_into
        ))
        self.play(Transform(
            dots, dots_end, rate_func=rush_from
        ))
        self.remove(dots)
示例#4
0
    def construct(self):
        circle = Circle(color=YELLOW).scale(self.radius)

        points = []
        lines = []
        for point in range(self.points):
            start_angle = (point / self.points) * 2 * np.pi
            start_point = (RIGHT * np.cos(start_angle) + UP * np.sin(start_angle)) * self.radius
            points.append(start_point)

            stop_angle = (point + point * self.step) / self.points * 2 * np.pi
            stop_point = (RIGHT * np.cos(stop_angle) + UP * np.sin(stop_angle)) * self.radius
            lines.append(Line(start_point, stop_point, **self.line_config))

        self.play(ShowCreation(circle))
        self.wait()

        points_group = VGroup(*[Dot(point, **self.dot_config) for point in points])
        lines_group = VGroup(*lines)

        # self.play(ShowCreation(points_group), run_time=2)
        self.play(ShowCreation(lines_group), run_time=10, rate_func=linear)
        self.wait()
示例#5
0
    def construct(self):
        dot = Dot()
        text = TextMobject("Label") \
            .next_to(dot, RIGHT, buff=SMALL_BUFF)

        self.add(dot, text)

        # Update function
        def update_text(obj):
            obj.next_to(dot, RIGHT, buff=SMALL_BUFF)

        # Add update function to the objects
        text.add_updater(update_text)

        # Add the object again
        self.add(text)

        self.play(dot.shift, UP * 2)

        # Remove update function
        text.remove_updater(update_text)

        self.wait()
示例#6
0
 def panel_opener_on_mouse_drag(self, mob, event_data):
     point = event_data["point"]
     self.panel_opener.match_y(Dot(point))
     self.move_panel_and_controls_to_panel_opener()
     return False
示例#7
0
 def panel_opener_on_mouse_drag(self, mob, event_data: dict[str, np.ndarray]) -> bool:
     point = event_data["point"]
     self.panel_opener.match_y(Dot(point))
     self.move_panel_and_controls_to_panel_opener()
     return False
示例#8
0
 def create_target(self):
     little_dot = Dot(radius=0)
     little_dot.set_fill(self.color, opacity=self.opacity)
     little_dot.add_updater(lambda d: d.move_to(self.focus_point))
     return little_dot
示例#9
0
 def panel_opener_on_mouse_drag(self, point, d_point, buttons, modifiers):
     self.panel_opener.match_y(Dot(point))
     self.move_panel_and_controls_to_panel_opener()
     return False
示例#10
0
    def __init__(self, file_name=None, **kwargs):
        Container.__init__(self, **kwargs)
        self.file_name = file_name or self.file_name
        self.ensure_valid_file()
        self.style = self.style.lower()
        self.gen_html_string()
        strati = self.html_string.find("background:")
        self.background_color = self.html_string[strati + 12:strati + 19]
        self.gen_code_json()

        self.code = self.gen_colored_lines()
        if self.insert_line_no:
            self.line_numbers = self.gen_line_numbers()
            self.line_numbers.next_to(self.code,
                                      direction=LEFT,
                                      buff=self.line_no_buff)

        if self.background == "rectangle":
            if self.insert_line_no:
                forground = VGroup(self.code, self.line_numbers)
            else:
                forground = self.code
            self.background_mobject = SurroundingRectangle(
                forground,
                buff=self.margin,
                color=self.background_color,
                fill_color=self.background_color,
                stroke_width=0,
                fill_opacity=1,
            )
            self.background_mobject.round_corners(self.corner_radius)
        else:
            if self.insert_line_no:
                forground = VGroup(self.code, self.line_numbers)
            else:
                forground = self.code

            height = forground.get_height() + 0.1 * 3 + 2 * self.margin
            width = forground.get_width() + 0.1 * 3 + 2 * self.margin

            rrect = RoundedRectangle(corner_radius=self.corner_radius,
                                     height=height,
                                     width=width,
                                     stroke_width=0,
                                     color=self.background_color,
                                     fill_opacity=1)
            red_button = Dot(radius=0.1, stroke_width=0, color='#ff5f56')
            red_button.shift(LEFT * 0.1 * 3)
            yellow_button = Dot(radius=0.1, stroke_width=0, color='#ffbd2e')
            green_button = Dot(radius=0.1, stroke_width=0, color='#27c93f')
            green_button.shift(RIGHT * 0.1 * 3)
            buttons = VGroup(red_button, yellow_button, green_button)
            buttons.shift(
                UP * (height / 2 - 0.1 * 2 - 0.05) + LEFT *
                (width / 2 - 0.1 * 5 - self.corner_radius / 2 - 0.05))

            self.background_mobject = VGroup(rrect, buttons)
            x = (height - forground.get_height()) / 2 - 0.1 * 3
            self.background_mobject.shift(forground.get_center())
            self.background_mobject.shift(UP * x)

        if self.insert_line_no:
            VGroup.__init__(self, self.background_mobject, self.line_numbers,
                            *self.code, **kwargs)
        else:
            VGroup.__init__(self, self.background_mobject,
                            Dot(fill_opacity=0, stroke_opacity=0), *self.code,
                            **kwargs)

        self.move_to(np.array([0, 0, 0]))
示例#11
0
    def __init__(self, file_name=None, code_str=None, **kwargs):
        Container.__init__(self, **kwargs)
        self.file_name = file_name
        self.code_str = code_str
        self.ensure_valid_file()
        self.style = self.style.lower()
        self.gen_html_string()
        strati = self.html_string.find("background:")
        self.background_color = self.html_string[strati + 12:strati + 19]
        self.gen_code_json()

        self.code = self.gen_colored_lines()

        if self.insert_line_no:
            self.line_numbers = self.gen_line_numbers()
            self.line_numbers.next_to(self.code,
                                      direction=LEFT,
                                      buff=self.line_no_buff)

        if self.background == "rectangle":
            if self.insert_line_no:
                forground = VGroup(self.code, self.line_numbers)
            else:
                forground = self.code
            self.background_mobject = SurroundingRectangle(
                forground,
                buff=self.margin,
                color=self.background_color,
                fill_color=self.background_color,
                stroke_width=0,
                fill_opacity=1,
            )

            self.background_mobject.round_corners(self.corner_radius)
        else:
            if self.insert_line_no:
                forground = VGroup(self.code, self.line_numbers)
            else:
                forground = self.code

            height = forground.get_height() + 0.1 * 3 + 2 * self.margin
            width = forground.get_width() + 0.1 * 3 + 2 * self.margin

            rrect = RoundedRectangle(corner_radius=self.corner_radius,
                                     height=height,
                                     width=width,
                                     stroke_width=0,
                                     color=GREY_E,
                                     fill_opacity=1)
            red_button = Dot(radius=0.1, stroke_width=0, color='#ff5f56')
            red_button.shift(LEFT * 0.1 * 3)
            yellow_button = Dot(radius=0.1, stroke_width=0, color='#ffbd2e')
            green_button = Dot(radius=0.1, stroke_width=0, color='#27c93f')
            green_button.shift(RIGHT * 0.1 * 3)
            buttons = VGroup(red_button, yellow_button, green_button)
            buttons.shift(
                UP * (height / 2 - 0.1 * 2 - 0.05) + LEFT *
                (width / 2 - 0.1 * 5 - self.corner_radius / 2 - 0.05))

            self.background_mobject = VGroup(rrect, buttons)
            x = (height - forground.get_height()) / 2 - 0.1 * 3
            self.background_mobject.shift(forground.get_center())
            self.background_mobject.shift(UP * x)

        if self.insert_line_no:
            VGroup.__init__(self, self.background_mobject, self.line_numbers,
                            *self.code, **kwargs)
        else:
            VGroup.__init__(self, self.background_mobject,
                            Dot(fill_opacity=0, stroke_opacity=0), *self.code,
                            **kwargs)

        window = RIGHT_SIDE[0] - LEFT_SIDE[0]
        width = self.background_mobject.get_width()
        print(width)
        scale_x = window / width * 0.96

        window = TOP[1] - BOTTOM[1]
        print(window)
        width = self.background_mobject.get_height()
        scale_y = window / width * 0.96

        if self.adapting_x and scale_x < scale_y:
            self.scale(scale_x)
        if self.adapting_y and scale_y <= scale_x:
            self.scale(scale_y)
        self.align_to(LEFT_SIDE + self.margin, LEFT)
        self.align_to(
            TOP - self.margin + 0.42 *
            (self.code.char_height + self.code.line_spacing) *
            self.scale_factor, UP)
示例#12
0
 def construct(self):
     if 1 == 1:
         try:
             self.add_sound(
                 "sidewayoutput\\basicmanim\\transform001a_01_01_01_01_01.wav",
                 time_offset=18)
             self.add_sound(
                 "sidewayoutput\\basicmanim\\transform001a_01_01_01_02_01.wav",
                 time_offset=93)
             self.add_sound(
                 "sidewayoutput\\basicmanim\\transform001a_01_01_01_03_01.wav",
                 time_offset=135)
         except:
             pass
         self.play(
             StartScreens01(
                 [],
                 [],
                 [[r"\textbf{\textit{Basic-Manim from }\{Sideway\}}"],
                  [r"\textbf{\textit{Transform}}\\{{Part\ \textspA{I}a}"],
                  [
                      r"\tiny{\textrm{basic-manim.210200551v0\_transform001a}}"
                  ], [],
                  [
                      r"\scriptsize{\textbf{Warning:\ The\ content\ may\ contain\ errors,\ mistakes\ and\ inaccuracies.\ Information\ must\ be\ verified\ and\ evaluated\ before\ use.}}"
                  ]],
             ))
     if 1 == 1:
         self.play(
             GrowFromCenter(
                 TextMobject(
                     r"\textit{\textbf{\underline{Transform}}}").shift(
                         [0, 3.6, 0])))
         squarea = Square()
         squareb = Square(side_length=4).shift([4, 0, 0])
         circlea = Circle()
         circleb = Circle(radius=2).shift([-4, 0, 0])
         linea = Line([-4, 3, 0], [4, 3, 0])
         lineb = Line([-3, -3, 0], [3, -3, 0])
         texta = TextMobject("AB").shift([0, -2.5, 0])
         textb = TextMobject("HI").shift([0, 2.5, 0])
         self.play(
             ShowCreation(Group(squarea, circlea, squareb, circleb, linea,
                                lineb),
                          lag_ratio=1,
                          run_time=12))
         self.play(Write(VGroup(texta, textb), lag_ratio=1, run_time=10))
         self.play(Transform(circlea, squarea, run_time=5))
         self.play(Transform(circlea, squareb, path_arc=3, run_time=5))
         self.play(Transform(squarea, circleb, path_arc=3, run_time=5))
         self.play(Transform(linea, lineb, path_arc=3, run_time=5))
         self.play(Transform(linea, circleb, path_arc=3, run_time=5))
         self.play(Transform(squareb, lineb, path_arc=3, run_time=5))
         self.play(Transform(texta, textb, path_arc=3, run_time=5))
         self.play(Transform(texta, circleb, path_arc=3, run_time=5))
         self.play(Transform(squareb, textb, path_arc=3, run_time=5))
         self.fadeout()
     if 1 == 1:
         self.play(
             GrowFromCenter(
                 TextMobject(
                     r"\textit{\textbf{\underline{Paths\ of\ Transform}}}").
                 shift([0, 3.6, 0])))
         rows, cols = (7, 5)
         x0, y0 = axes_point([0, 2, cols - 1, -4], [2.3, -1, rows - 1, 3])
         txtx = ["loc 1", "loc 2", "m1", "m2"]
         txty = [
             "ClockwiseTransform", "Transform", "CounterclockwiseTransform"
         ]
         a1 = Group()
         a2 = Group()
         a3 = Group()
         a4 = Group()
         for j in range(1, rows):
             a1.add(Circle().scale(0.2).move_to([x0[1], y0[j], 0]))
             a2.add(Square().scale(0.2).move_to([x0[2], y0[j], 0]))
             a3.add(
                 Dot([x0[3], y0[j], 0]).add_updater(lambda mob, obj=a1[
                     j - 1], x=x0[3], y=y0[j]: mob.become(obj.copy(
                     ).move_to([x, y, 0]))).suspend_updating())
             a4.add(
                 Dot([x0[4], y0[j], 0]).add_updater(lambda mob, obj=a2[
                     j - 1], x=x0[4], y=y0[j]: mob.become(obj.copy(
                     ).move_to([x, y, 0]))).suspend_updating())
         self.play(FadeIn(
             Group(
                 *[
                     TextMobject(txtx[i]).move_to(each)
                     for i, each in enumerate(coord_grid(x0[1:], y0[0:1]))
                 ], *[
                     TextMobject(txty[i]).move_to(each)
                     for i, each in enumerate(coord_grid(x0[0:1], y0[1::2]))
                 ], *[Dot(each) for each in coord_grid(x0[1:3], y0[1:])],
                 TextMobject(r"$\rightarrow$").move_to(
                     ([(x0[1] + x0[2]) / 2, y0[0], 0])), a1[::2], a2[::2],
                 a3, a4, *[
                     Square(stroke_width=2,
                            color="#FFFF00",
                            fill_opacity=0.3).add_updater(
                                lambda mob, obj=obj: mob.surround(
                                    obj, stretch=True, buff=0.2))
                     for obj in a1
                 ], *[
                     Square(stroke_width=2, color="#DC75CD").add_updater(
                         lambda mob, obj=obj: mob.surround(
                             obj, stretch=True, buff=0.3)) for obj in a2
                 ])),
                   run_time=5)
         self.wait(2)
         self.play(AnimationGroup(
             ClockwiseTransform(a2[0], a1[0]),
             ClockwiseTransform(a1[1], a2[1]),
             Transform(a1[2], a2[2]),
             Transform(a2[3], a1[3]),
             CounterclockwiseTransform(a1[4], a2[4]),
             CounterclockwiseTransform(a2[5], a1[5]),
         ),
                   run_time=25)
         self.wait(3)
         a1.shift([0.3, 0, 0]).set_color("#11FF00")
         self.wait(3)
         self.play(ApplyMethod(a1.shift, ([0.3, 0, 0])), run_time=3)
         self.fadeout()
     if 1 == 1:
         self.play(
             GrowFromCenter(
                 TextMobject(
                     r"\textit{\textbf{\underline{Methods\ of\ Transform}}}"
                 ).shift([0, 3.6, 0])))
         rows, cols = (9, 5)
         x0, y0 = axes_point([0, 2, cols - 1, -4], [2.3, -0.8, rows - 1, 3])
         txtx = ["loc 1", "loc 2", "m1", "m2"]
         txty = [
             "Transform", "ReplacementTransform", "TransformFromCopy",
             "MoveToTarget"
         ]
         a1 = Group()
         a2 = Group()
         a3 = Group()
         a4 = Group()
         for j in range(1, rows):
             a1.add(Circle().scale(0.2).move_to([x0[1], y0[j], 0]))
             a2.add(Square().scale(0.2).move_to([x0[2], y0[j], 0]))
             a3.add(Dot().move_to([x0[3], y0[j], 0]).add_updater(
                 lambda mob, obj=a1[j - 1], x=x0[3], y=y0[j]: mob.become(
                     obj.copy().move_to([x, y, 0]))).suspend_updating())
             a4.add(Dot().move_to([x0[4], y0[j], 0]).add_updater(
                 lambda mob, obj=a2[j - 1], x=x0[4], y=y0[j]: mob.become(
                     obj.copy().move_to([x, y, 0]))).suspend_updating())
         a1[6].target = a2[6]
         a1[7].target = a2[7]
         self.play(FadeIn(
             Group(
                 *[
                     TextMobject(txtx[i]).move_to(each)
                     for i, each in enumerate(coord_grid(x0[1:], y0[0:1]))
                 ], *[
                     TextMobject(txty[i]).move_to(each)
                     for i, each in enumerate(coord_grid(x0[0:1], y0[1::2]))
                 ], *[Dot(each) for each in coord_grid(x0[1:3], y0[1:])],
                 TextMobject(r"$\rightarrow$").move_to(
                     ([(x0[1] + x0[2]) / 2, y0[0], 0])), a1[::2], a2[::2],
                 a3, a4,
                 Group(*[
                     Square(
                         stroke_width=2, color="#FFFF00", fill_opacity=0.3).
                     add_updater(lambda mob, obj=obj: mob.surround(
                         obj, stretch=True, buff=0.2)) for obj in a1
                 ]),
                 Group(*[
                     Square(stroke_width=2, color="#DC75CD").add_updater(
                         lambda mob, obj=obj: mob.surround(
                             obj, stretch=True, buff=0.3)) for obj in a2
                 ]))),
                   run_time=5)
         self.wait(2)
         self.play(AnimationGroup(Transform(a1[0], a2[0]),
                                  Transform(a1[1], a2[1]),
                                  ReplacementTransform(a1[2], a2[2]),
                                  ReplacementTransform(a1[3], a2[3]),
                                  TransformFromCopy(a1[4], a2[4]),
                                  TransformFromCopy(a1[5], a2[5]),
                                  MoveToTarget(a1[6]), MoveToTarget(a1[7])),
                   run_time=40)
         self.wait(3)
         a1.shift([0.3, 0, 0]).set_color("#11FF00")
         self.wait(10)
         self.play(ApplyMethod(a1.shift, ([0.3, 0, 0])), run_time=5)
         self.fadeout()
     if 1 == 1:
         self.play(EndScreen01())
     self.wait(5)
    def construct(self):

        np.random.seed(2007)
        points = [
            [np.random.randint(-70000, 70000)/10500, np.random.randint(-38000, 38000)/10500, 0] for i in range(800)
        ]
        #points = [UL, UP, UR, LEFT, ORIGIN, RIGHT, DL, DOWN, DR]
        #points = [UL, DR, UR, DL]
        dots = [Dot(p).scale(0.5) for p in points]
        self.add(*dots)
        start = time.perf_counter()
        net = Voronoi(*points)
        self.add(net)
        end = time.perf_counter()
        print(end - start)

        '''
        p1, p2, p3 = DL, UL, UR
        p4 = DR
        p5 = ORIGIN
        p6 = UL/2
        p7 = UL
        p8 = UL*2
        print(InTriangle(p1, p2, p3, p4))
        print(InTriangle(p1, p2, p3, p5))
        print(InTriangle(p1, p2, p3, p6))
        print(InTriangle(p1, p2, p3, p7))
        print(InTriangle(p1, p2, p3, p8))
        print(InCircle(p1, p2, p3, p4))
        print(InCircle(p1, p2, p3, p5))
        print(InCircle(p1, p2, p3, p6))
        print(InCircle(p1, p2, p3, p7))
        print(InCircle(p1, p2, p3, p8))
        '''
        '''
        infnet = InitInfNet()
        he1 = infnet.HalfEdge
        he2 = he1.Suc
        he3 = he2.Suc
        print(get_polygon_directed_area(Polygon(he1.Start.Point, he2.Start.Point, he3.Start.Point)))
        '''
        '''
        np.random.seed(2007)
        points = [
            [np.random.randint(-70000, 70000)/10500, np.random.randint(-38000, 38000)/10500, 0] for i in range(1000)
        ]
        #points = [UL, UP, UR, LEFT, ORIGIN, RIGHT, DL, DOWN, DR]
        #points = [UL, DR, UR, DL]
        dots = [Dot(p) for p in points]
        #self.add(*dots)
        start = time.perf_counter()
        delaunay = ConstructNet(self, points)
        net = VisitNet(delaunay)
        end = time.perf_counter()
        print(end - start)
        self.add(net)
        '''
        '''
        np.random.seed(2000007)
        points = [
            [np.random.randint(-70000, 70000)/10000, np.random.randint(-38000, 38000)/10000, 0] for i in range(7)
        ]
        dots = [Dot(p) for p in points]
        self.add(*dots)
        start = time.perf_counter()
        delaunay = InitInfNet(points)
        #print(points[0])
        net1, net2, net3 = ClipFace(delaunay, Vertice(points[0]), points[1:])
        net = VisitTriangles(net1)
        end = time.perf_counter()
        print(end - start)
        self.add(net)
        '''
        '''
        p1, p2, p3, p4 = UL, UR*2, DR, DL*2
        v1, v2, v3, v4 = Vertice(p1), Vertice(p2), Vertice(p3), Vertice(p4)
        he1 = HalfEdge(v1, v2)
        he2 = HalfEdge(v2, v3)
        he3 = HalfEdge(v3, v4)
        he4 = HalfEdge(v4, v1)
        he5 = HalfEdge(v3, v1)
        he6 = HalfEdge(v1, v3)

        he1.Suc = he2
        he2.Pre = he1
        he2.Suc = he5
        he5.Pre = he2
        he5.Suc = he1
        he1.Pre = he5

        he3.Suc = he4
        he4.Pre = he3
        he4.Suc = he6
        he6.Pre = he4
        he6.Suc = he3
        he3.Pre = he6

        bucket1 = Bucket([UR+RIGHT/5, UR+LEFT/5])
        bucket2 = Bucket([])

        face1 = Face(he1)
        face1.Bucket = bucket1
        bucket1.Face = face1
        he1.Face = face1
        he2.Face = face1
        he5.Face = face1
        face2 = Face(he3)
        face2.Bucket = bucket2
        bucket2.Face = face2
        he3.Face = face2
        he4.Face = face2
        he6.Face = face2
        he5.Twin = he6
        he6.Twin = he5

        EdgeFlipping(he5)
        start = time.perf_counter()
        net = VisitInfNet(face1)
        end = time.perf_counter()
        print(end - start)

        print(get_polygon_directed_area(Polygon(face1.HalfEdge.Start.Point, face1.HalfEdge.Suc.Start.Point,
                      face1.HalfEdge.Suc.Suc.Start.Point)))
        print(get_polygon_directed_area(Polygon(face2.HalfEdge.Start.Point, face2.HalfEdge.Suc.Start.Point,
                      face2.HalfEdge.Suc.Suc.Start.Point)))
        self.add(net)
        '''
        #p1, p2, p3, p4 = UL, UR, DR, DL
        #print(InTriangle(p1, p2, p3, ORIGIN), InTriangle(p1, p2, p3, UR/2), InTriangle(p1, p2, p3, p4))
        '''
        start = time.perf_counter()
        print(
            InCircle(p1, p2, p3, p4),
            InCircle(p1, p2, p3, ORIGIN),
            InCircle(p1, p2, p3, p4+LEFT)
        )
        end = time.perf_counter()
        print(end - start)
        start = time.perf_counter()
        print(
            InCircle2(p1, p2, p3, p4),
            InCircle2(p1, p2, p3, ORIGIN),
            InCircle2(p1, p2, p3, p4+LEFT)
        )
        end = time.perf_counter()
        print(end - start)
        '''
        self.wait()