예제 #1
0
 def __init__(self):
     super().__init__()
     backbutton()
     g = CartesianGraph((0, 0), height = 127, width = 127, xorigin = 10)
     tsy = TSequence(g, YELLOW, 50)
     tsr = TSequence(g, RED, 50)
     self.reg_task(self.acquire(g, tsy, tsr), on_change=True)
예제 #2
0
 def __init__(self):
     super().__init__()
     self.buttonlist = []
     self.buttonlist.append(backbutton())
     self.buttonlist.append(ovlbutton())
     cartesian_graph = CartesianGraph((0, 0), height = 127, width = 127)
     self.buttonlist.append(clearbutton(cartesian_graph))
     curve = Curve(cartesian_graph, self.populate)
     self.buttonlist.append(refreshbutton((curve,)))
예제 #3
0
 def __init__(self):
     super().__init__()
     backbutton()
     ovlbutton()
     g = CartesianGraph((0, 0), height = 127, width = 135, yorigin = 2) # Asymmetric y axis
     clearbutton(g)
     curve1 = Curve(g, self.populate_1, (lambda x : x**3 + x**2 -x,)) # args demo
     curve2 = Curve(g, self.populate_2, color = RED)
     refreshbutton((curve1, curve2))
예제 #4
0
 def __init__(self):
     super().__init__()
     backbutton()
     ovlbutton()
     g = CartesianGraph((5, 5), height = 115, width = 115)
     clearbutton(g)
     curve1 = Curve(g, self.populate_1, (1.1,))
     curve2 = Curve(g, self.populate_1, (1.05,), color=RED)
     curve3 = Curve(g, self.populate_3, color=BLUE)
     refreshbutton((curve1, curve2, curve3))
예제 #5
0
    def __init__(self):
        super().__init__()
        def populate_3(curve):
            for x, y in ((-2, -0.2), (-2, 0.2), (-0.2, -2), (0.2, -2), (2, 0.2), (2, -0.2), (0.2, 2), (-0.2, 2)):
                yield x, y
                yield 0, 0
                yield None, None

        def populate_1(curve, mag):
            theta = 0
            delta = pi/32
            while theta <= 2 * pi:
                yield mag*sin(theta), mag*cos(theta)
                theta += delta

        backbutton()
        ovlbutton()
        g = CartesianGraph((5, 5), height = 115, width = 115)
        clearbutton(g)
        curve1 = Curve(g, populate_1, (1.1,))
        curve2 = Curve(g, populate_1, (1.05,), color=RED)
        curve3 = Curve(g, populate_3, color=BLUE)
        refreshbutton((curve1, curve2, curve3))
예제 #6
0
    def __init__(self):
        super().__init__()
        def populate_1(curve, func):
            x = -1
            while x < 1.01:
                y = func(x)
                yield x, y
                x += 0.1

        def populate_2(curve):
            x = -1
            while x < 1.01:
                y = x**2
                yield x, y
                x += 0.1

        backbutton()
        ovlbutton()
        g = CartesianGraph((0, 0), height = 127, width = 135, yorigin = 2) # Asymmetric y axis
        clearbutton(g)
        curve1 = Curve(g, populate_1, (lambda x : x**3 + x**2 -x,)) # args demo
        curve2 = Curve(g, populate_2, color = RED)
        refreshbutton((curve1, curve2))