Пример #1
0
    def effectOf_pushButtonCPMTOrbitsRandomCircle(self):
        MobiusTrans = Mobius_CP.MobiusAssocToMatrix(
            self.lineEditCPMTOrbitsComplexNumberalpha.text(),
            self.lineEditCPMTOrbitsComplexNumberbeta.text(),
            self.lineEditCPMTOrbitsComplexNumbergamma.text(),
            self.lineEditCPMTOrbitsComplexNumberdelta.text())
        P = numpy.complex(numpy.random.random(), numpy.random.random())
        Q = numpy.complex(numpy.random.random(), numpy.random.random())
        R = numpy.complex(numpy.random.random(), numpy.random.random())
        numberOfPointsInOrbit = int(self.spinBoxCPMTOrbits.cleanText())
        OrbitP = MobiusTrans.Mob_trans_iterable(P, numberOfPointsInOrbit)
        OrbitQ = MobiusTrans.Mob_trans_iterable(Q, numberOfPointsInOrbit)
        OrbitR = MobiusTrans.Mob_trans_iterable(R, numberOfPointsInOrbit)

        pointsForPlotP = Steiner_grids_CP.coordsOfComplex().coords(OrbitP)
        pointsForPlotQ = Steiner_grids_CP.coordsOfComplex().coords(OrbitQ)
        pointsForPlotR = Steiner_grids_CP.coordsOfComplex().coords(OrbitR)

        centersAndRadii = [
            (Steiner_grids_CP.commonCircles().commonCirclesFunction(
                OrbitP[k], OrbitQ[k]))(OrbitR[k])
            for k in range(0, numberOfPointsInOrbit, 1)
        ]

        t = numpy.linspace(0, 2 * numpy.pi, 500)

        for k in range(0, numberOfPointsInOrbit, 1):
            self.mplWidgetIn_pageCP.canvas.axis.plot(
                ((centersAndRadii[k])[0])[0] +
                (centersAndRadii[k])[1] * numpy.cos(t),
                ((centersAndRadii[k])[0])[1] +
                (centersAndRadii[k])[1] * numpy.sin(t), 'b-')

        line, = self.mplWidgetIn_pageCP.canvas.axis.plot(
            ((centersAndRadii[0])[0])[0] +
            (centersAndRadii[0])[1] * numpy.cos(t),
            ((centersAndRadii[0])[0])[1] +
            (centersAndRadii[0])[1] * numpy.sin(t),
            'r-',
            linewidth=3)

        def update(k):
            # Update the line and the axes (with a new xlabel). Return a tuple of
            # "artists" that have to be redrawn for this frame.
            line.set_xdata(((centersAndRadii[k])[0])[0] +
                           (centersAndRadii[k])[1] * numpy.cos(t))
            line.set_ydata(((centersAndRadii[k])[0])[1] +
                           (centersAndRadii[k])[1] * numpy.sin(t))
            return line,

        anim = FuncAnimation(
            self.mplWidgetIn_pageCP.canvas.fig,
            update,
            #init_func=init,
            frames=numberOfPointsInOrbit,
            interval=250,
            blit=True)
        self.mplWidgetIn_pageCP.canvas.draw()
Пример #2
0
    def effectOf_pushButtonCPMTOrbitsSinglePoint(self):
        MobiusTrans = Mobius_CP.MobiusAssocToMatrix(
            self.lineEditCPMTOrbitsComplexNumberalpha.text(),
            self.lineEditCPMTOrbitsComplexNumberbeta.text(),
            self.lineEditCPMTOrbitsComplexNumbergamma.text(),
            self.lineEditCPMTOrbitsComplexNumberdelta.text())
        z_0 = numpy.complex(self.lineEditCPMTOrbitsComplexNumberz_0.text())
        numberOfPointsInOrbit = int(self.spinBoxCPMTOrbits.cleanText())
        Orbit = MobiusTrans.Mob_trans_iterable(z_0, numberOfPointsInOrbit)
        pointsForPlot = Steiner_grids_CP.coordsOfComplex().coords(Orbit)

        for k in range(0, numberOfPointsInOrbit, 1):
            self.mplWidgetIn_pageCP.canvas.axis.plot(
                (pointsForPlot[0])[k], (pointsForPlot[1])[k], 'ob')
        line, = self.mplWidgetIn_pageCP.canvas.axis.plot((pointsForPlot[0])[0],
                                                         (pointsForPlot[1])[0],
                                                         marker='o',
                                                         color='r')

        def update(i):
            # Update the line and the axes (with a new xlabel). Return a tuple of
            # "artists" that have to be redrawn for this frame.
            line.set_xdata((pointsForPlot[0])[i])
            line.set_ydata((pointsForPlot[1])[i])
            return line,
#        x = numpy.arange(0, 20, 0.1)
#        self.mplWidgetIn_pageCP.canvas.axis.scatter(x, x + numpy.random.normal(0, 3.0, len(x)))
#        line, = self.mplWidgetIn_pageCP.canvas.axis.plot(x, x - 5, 'r-', linewidth=2)
#
#        def update(i):
#            # Update the line and the axes (with a new xlabel). Return a tuple of
#            # "artists" that have to be redrawn for this frame.
#            line.set_ydata(x - 5 + i)
#            return line,

#        initialPlot, = self.mplWidgetIn_pageCP.canvas.axis.plot((pointsForPlot[0])[0],(pointsForPlot[1])[0],'or', animated = True)
#
##        def init():
##            initialPlot.set_data([],[])
##            return initialPlot,
#
#        def animate(k):
#            x = (pointsForPlot[0])[k]
#            y = (pointsForPlot[1])[k]
#            print(x,y)
#            initialPlot.set_data(x,y)
#            return initialPlot,
#

        anim = FuncAnimation(
            self.mplWidgetIn_pageCP.canvas.fig,
            update,
            #init_func=init,
            frames=numberOfPointsInOrbit,
            interval=500,
            blit=True)
        self.mplWidgetIn_pageCP.canvas.draw()
Пример #3
0
 def UHPCheckIfTheGroupIsFuchsianForSpecificSidePairing(
         self, genus, numberOfPunctures):
     g, p = genus, numberOfPunctures
     if g == 0 and p < 3:
         pass
     elif g == 1 and p == 0:
         pass
     else:
         sidePairings = self.UHPSidePairingsOfSpecificIdealPolygon(g, p)
         orbits = self.UHPVertexOrbitsUnderSpecificCombinatorialSidePairing(
             g, p)
         for orbit in orbits:
             transformation = sidePairings[orbit[0]]
             j = 1
             while j < len(orbit):
                 transformation = sidePairings[orbit[j]] * transformation
                 j = j + 1
             print(Mobius_CP.MobiusAssocToMatrix().isParEllHypLox(
                 transformation[0, 0], transformation[0, 1],
                 transformation[1, 0], transformation[1, 1]))