Esempio n. 1
0
 def __init__(self, **kwargs):
     digest_config(self, kwargs)
     videos = [VideoIcon() for x in range(self.num_videos)]
     VGroup.__init__(self, *videos, **kwargs)
     self.arrange_submobjects()
     self.scale_to_fit_width(2*SPACE_WIDTH-MED_LARGE_BUFF)
     self.gradient_highlight(*self.gradient_colors)
Esempio n. 2
0
 def __init__(self, mobject, **kwargs):
     VGroup.__init__(self, 
         Line(UP+LEFT, DOWN+RIGHT),
         Line(UP+RIGHT, DOWN+LEFT),
     )
     self.replace(mobject, stretch = True)
     self.set_stroke(self.stroke_color, self.stroke_width)
Esempio n. 3
0
 def __init__(self, mobject, **kwargs):
     VGroup.__init__(self, 
         Line(UP+LEFT, DOWN+RIGHT),
         Line(UP+RIGHT, DOWN+LEFT),
     )
     self.replace(mobject, stretch = True)
     self.set_stroke(self.stroke_color, self.stroke_width)
Esempio n. 4
0
 def __init__(self, **kwargs):
     digest_config(self, kwargs)
     videos = [VideoIcon() for x in range(self.num_videos)]
     VGroup.__init__(self, *videos, **kwargs)
     self.arrange_submobjects()
     self.scale_to_fit_width(2 * SPACE_WIDTH - MED_LARGE_BUFF)
     self.gradient_highlight(*self.gradient_colors)
Esempio n. 5
0
 def __init__(self, integer, **kwargs):
     num_str = str(integer)
     VGroup.__init__(self, *map(TexMobject, num_str), **kwargs)
     self.arrange_submobjects(RIGHT,
                              buff=self.digit_buff,
                              aligned_edge=DOWN)
     if num_str[0] == "-":
         self[0].next_to(self[1], LEFT, buff=SMALL_BUFF)
Esempio n. 6
0
    def __init__(self, values, **kwargs):
        VGroup.__init__(self, **kwargs)
        if self.max_value is None:
            self.max_value = max(values)

        self.add_axes()
        self.add_bars(values)
        self.center()
Esempio n. 7
0
 def __init__(self, **kwargs):
     possible_values = map(str, range(1, 11)) + ["J", "Q", "K"]
     possible_suits = ["hearts", "diamonds", "spades", "clubs"]
     VGroup.__init__(self, *[
         PlayingCard(value = value, suit = suit, **kwargs)
         for value in possible_values
         for suit in possible_suits
     ])
Esempio n. 8
0
 def __init__(self, **kwargs):
     possible_values = map(str, range(1, 11)) + ["J", "Q", "K"]
     possible_suits = ["hearts", "diamonds", "spades", "clubs"]
     VGroup.__init__(self, *[
         PlayingCard(value = value, suit = suit, **kwargs)
         for value in possible_values
         for suit in possible_suits
     ])
Esempio n. 9
0
 def __init__(self, integer, **kwargs):
     num_str = str(integer)
     VGroup.__init__(self, *map(TexMobject, num_str), **kwargs)
     self.arrange_submobjects(
         RIGHT, buff = self.digit_buff, aligned_edge = DOWN
     )
     if num_str[0] == "-":
         self[0].next_to(self[1], LEFT, buff = SMALL_BUFF)
Esempio n. 10
0
 def __init__(self, **kwargs):
     VGroup.__init__(self, **kwargs)
     self.x_axis = self.get_axis(self.x_min, self.x_max, self.x_axis_config)
     self.y_axis = self.get_axis(self.y_min, self.y_max, self.y_axis_config)
     self.y_axis.rotate(np.pi/2)
     self.add(self.x_axis, self.y_axis)
     if self.three_d:
         self.z_axis = self.get_axis(self.z_min, self.z_max, self.z_axis_config)
         self.z_axis.rotate(-np.pi/2, UP)
         self.z_axis.rotate(angle_of_vector(self.z_normal), OUT)
         self.add(self.z_axis)
Esempio n. 11
0
    def __init__(self, **kwargs):
        circle = Circle()
        ticks = []
        for x in range(12):
            alpha = x / 12.
            point = complex_to_R3(np.exp(2 * np.pi * alpha * complex(0, 1)))
            length = 0.2 if x % 3 == 0 else 0.1
            ticks.append(Line(point, (1 - length) * point))
        self.hour_hand = Line(ORIGIN, 0.3 * UP)
        self.minute_hand = Line(ORIGIN, 0.6 * UP)
        # for hand in self.hour_hand, self.minute_hand:
        #     #Balance out where the center is
        #     hand.add(VectorizedPoint(-hand.get_end()))

        VGroup.__init__(self, circle, self.hour_hand, self.minute_hand, *ticks)
Esempio n. 12
0
 def __init__(self, **kwargs):
     VGroup.__init__(self, **kwargs)
     self.x_axis = NumberLine(x_min=self.x_min,
                              x_max=self.x_max,
                              **self.number_line_config)
     self.y_axis = NumberLine(x_min=self.y_min,
                              x_max=self.y_max,
                              **self.number_line_config)
     self.y_axis.rotate(np.pi / 2)
     self.add(self.x_axis, self.y_axis)
     if self.three_d:
         self.z_axis = NumberLine(x_min=self.z_min,
                                  x_max=self.z_max,
                                  **self.number_line_config)
         self.z_axis.rotate(-np.pi / 2, UP)
         self.z_axis.rotate(angle_of_vector(self.z_normal), OUT)
         self.add(self.z_axis)
Esempio n. 13
0
 def __init__(self, **kwargs):
     VGroup.__init__(self, **kwargs)
     self.x_axis = NumberLine(
         x_min = -self.x_axis_radius,
         x_max = self.x_axis_radius,
         **self.number_line_config
     )
     self.y_axis = NumberLine(
         x_min = -self.y_axis_radius,
         x_max = self.y_axis_radius,
         **self.number_line_config
     )
     self.y_axis.rotate(np.pi/2)
     self.add(self.x_axis, self.y_axis)
     if self.three_d:
         self.z_axis = NumberLine(
             x_min = -self.y_axis_radius,
             x_max = self.y_axis_radius,
             **self.number_line_config
         )
         self.z_axis.rotate(np.pi/2, UP)
         self.add(self.z_axis)
Esempio n. 14
0
    def __init__(self, **kwargs):
        circle = Circle()
        ticks = []
        for x in range(12):
            alpha = x/12.
            point = complex_to_R3(
                np.exp(2*np.pi*alpha*complex(0, 1))
            )
            length = 0.2 if x%3 == 0 else 0.1
            ticks.append(
                Line(point, (1-length)*point)
            )
        self.hour_hand = Line(ORIGIN, 0.3*UP)
        self.minute_hand = Line(ORIGIN, 0.6*UP)
        # for hand in self.hour_hand, self.minute_hand:
        #     #Balance out where the center is
        #     hand.add(VectorizedPoint(-hand.get_end()))

        VGroup.__init__(
            self, circle, 
            self.hour_hand, self.minute_hand,
            *ticks
        )
Esempio n. 15
0
 def __init__(self, **kwargs):
     VGroup.__init__(self)
     self.x_axis = NumberLine(**kwargs)
     self.y_axis = NumberLine(**kwargs).rotate(np.pi/2)
     self.add(self.x_axis, self.y_axis)
Esempio n. 16
0
 def __init__(self, **kwargs):
     VGroup.__init__(self, **kwargs)
     full_space = Rectangle(**self.full_space_config)
     self.full_space = full_space
     self.add(full_space)
Esempio n. 17
0
 def __init__(self, key = None, **kwargs):
     VGroup.__init__(self, key = key, **kwargs)
Esempio n. 18
0
 def __init__(self, key = None, **kwargs):
     VGroup.__init__(self, key = key, **kwargs)
Esempio n. 19
0
 def __init__(self, **kwargs):
     digest_config(self, kwargs)
     videos = [VideoIcon() for x in range(self.num_videos)]
     VGroup.__init__(self, *videos, **kwargs)
     self.arrange_submobjects()
     self.gradient_highlight(*self.gradient_colors)
Esempio n. 20
0
 def __init__(self, **kwargs):
     VGroup.__init__(self, **kwargs)
     full_space = Rectangle(**self.full_space_config)
     self.full_space = full_space
     self.add(full_space)
Esempio n. 21
0
 def __init__(self, **kwargs):
     digest_config(self, kwargs)
     videos = [VideoIcon() for x in range(self.num_videos)]
     VGroup.__init__(self, *videos, **kwargs)
     self.arrange_submobjects()
     self.gradient_highlight(*self.gradient_colors)
Esempio n. 22
0
 def __init__(self, **kwargs):
     VGroup.__init__(self)
     self.x_axis = NumberLine(**kwargs)
     self.y_axis = NumberLine(**kwargs).rotate(np.pi / 2)
     self.add(self.x_axis, self.y_axis)