Exemplo n.º 1
0
 def construct(self):
     my_plane = NumberPlane(x_line_frequency=2,
                            y_line_frequency=2,
                            faded_line_ratio=2)
     my_plane.add(my_plane.get_axis_labels())
     self.add(my_plane)
     self.wait()
Exemplo n.º 2
0
    def construct(self):
        plane = NumberPlane(**self.plane_kwargs)
        plane.add(plane.get_axis_labels())
        self.add(plane)

        self.field = VGroup(*[
            self.calc_field(x * RIGHT + y * UP) for x in np.arange(-9, 9, 1)
            for y in np.arange(-5, 5, 1)
        ])

        source_charge = self.Positron().move_to(self.point_charge_loc)
        self.play(FadeIn(source_charge))
        self.play(ShowCreation(self.field))
        self.moving_charge()
Exemplo n.º 3
0
    def construct(self):
        plane = NumberPlane()
        plane.add(plane.get_axis_labels())
        self.add(plane)

        points = [
            x * RIGHT + y * UP for x in np.arange(-5, 5, 1)
            for y in np.arange(-5, 5, 1)
        ]

        vec_field = []
        for point in points:
            field = 0.5 * RIGHT + 0.5 * UP
            result = Vector(field).shift(point)
            vec_field.append(result)

        draw_field = VGroup(*vec_field)

        self.play(ShowCreation(draw_field))
        self.wait(2)