Esempio n. 1
0
 def __init__(self, function, mobject, **kwargs):
     if "path_func" not in kwargs:
         self.path_func = path_along_arc(np.log(function(complex(1))).imag)
     ApplyPointwiseFunction.__init__(
         self,
         lambda x_y_z: complex_to_R3(function(complex(x_y_z[0], x_y_z[1]))),
         instantiate(mobject), **kwargs)
Esempio n. 2
0
 def __init__(self, function, mobject = ComplexPlane, **kwargs):
     if "path_func" not in kwargs:
         self.path_func = path_along_arc(
             np.log(function(complex(1))).imag
         )
     ApplyPointwiseFunction.__init__(
         self,
         lambda (x, y, z) : complex_to_R3(function(complex(x, y))),
         instantiate(mobject),
         **kwargs
     )
Esempio n. 3
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. 4
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. 5
0
 def apply_complex_function(self, function, **kwargs):
     return self.apply_function(
         lambda (x, y, z): complex_to_R3(function(complex(x, y))), **kwargs)
Esempio n. 6
0
 def apply_complex_function(self, function, **kwargs):
     return self.apply_function(
         lambda x_y_z: complex_to_R3(function(complex(x_y_z[0], x_y_z[1]))),
         **kwargs
     )
Esempio n. 7
0
 def apply_complex_function(self, function, **kwargs):
     return self.apply_function(
         lambda (x, y, z): complex_to_R3(function(complex(x, y))),
         **kwargs
     )