martes, 26 de septiembre de 2017

Blog Recomendado para trabajar poligonos:

eduardommm.blogspot.mx

Aquí tenemos el código que diseño: Aquino Sánchez Eduardo Pablo
(contiene polígono con figura de un Gato)

usa un plano cartesiano online:
https://www.geogebra.org/m/Wk7Y7N6V

y se apoya en la búsqueda de figuras hechas con puntos:
https://www.google.com.mx/search?q=figuras+hechas+con+puntos&sa=X&tbm=isch&tbo=u&source=univ&ved=0ahUKEwjW4fbAzsPWAhUJ8mMKHRB-CTQQ7AkINQ&biw=1366&bih=589#imgrc=OUAIJu2Tp816OM:


Esta liga contie figuras para plano cartesiano con puntos:
https://www.google.com.mx/search?q=figuras+para+plano+cartesiano+con+puntos&sa=X&tbm=isch&imgil=dW6zkZmqd7Ap5M%253A%253Bd1TIg7SiaFxiKM%253Bhttp%25253A%25252F%25252Fwww.curriculumenlineamineduc.cl%25252F605%25252Fw3-propertyvalue-67630.html&source=iu&pf=m&fir=dW6zkZmqd7Ap5M%253A%252Cd1TIg7SiaFxiKM%252C_&usg=__Ok5PWZ8Hf3vKzKGwXGJOXz82kfs%3D&biw=1366&bih=589&ved=0ahUKEwj0uYHL0MPWAhUCxlQKHeFKAhoQyjcINg&ei=WbDKWbSpGYKM0wLhlYnQAQ#imgrc=dW6zkZmqd7Ap5M:




# -*- coding: utf-8 -*-from Tkinter import *
v0 = Tk()
v0.title("Ventana madre")
v0.config(bg="black")
v0.geometry("1400x200")
def mostrar(num):
    v1 = Toplevel(v0)
    v1.title("Ventana hija")
    v1.protocol("WM_DELETE_WINDOW", "onexit")
    v1.config(bg="black")
    v1.geometry("500x500")
    if  num==1:
     hola = Canvas(v1, width=300, height=210, bg='white')
     hola.pack(expand=YES, fill=BOTH)
     hola.create_oval(10, 10, 200, 200, width=5, fill='blue')
     b3 = Button(hola, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)
    elif num == 2:
     canvas = Canvas(v1,width=300, height=210, bg='white')
     canvas.pack(expand=YES, fill=BOTH)
     canvas.create_rectangle(10, 10, 200, 200, width=5, fill='red')
     b3 = Button(canvas, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)
    elif num == 3:
     canvas2 = Canvas(v1,width=300, height=210, bg='white')
     canvas2.pack(expand=YES, fill=BOTH)
     canvas2.create_line(0, 200, 200, 0, width=10, fill='green')
     canvas2.create_line(0, 0, 200, 200, width=10, fill='red')
     b3 = Button(canvas2, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)
     v1.deiconify()
    elif num == 4:
     canvas = Canvas(v1, width=300, height=200, bg='white')
     canvas.pack(expand=YES, fill=BOTH)
     xy = 10, 10, 190, 190     canvas.create_arc(xy, start=0, extent=270, fill='gray60')
     b3 = Button(canvas, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)
     v1.deiconify()
    elif num == 5:
     canvas123 = Canvas(v1,width=300, height=200, bg='white')
     canvas123.pack(expand=YES, fill=BOTH)
     canvas123.create_arc(10, 10, 190, 190, start=270, extent=90, fill='gray90')
     b3 = Button(canvas123, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)
     v1.deiconify()

    elif num == 6:

     canvas = Canvas(v1, width=300, height=200, bg='white')

     canvas.pack(expand=YES, fill=BOTH)
     xy = 10, 10, 190, 190     canvas.create_arc(xy, start=0, extent=270, fill='gray60')

     canvas.create_arc(10, 10, 190, 190, start=270, extent=90, fill='gray90')
     b3 = Button(canvas, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)

     v1.deiconify()
    elif num == 7:

     canvas = Canvas(v1, width=300, height=200, bg='white')
     canvas.pack(expand=YES, fill=BOTH)
     canvas.create_text(150,70,fill="Red",font="Times",text="Hola \nmundo")
     b3 = Button(canvas, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)
    elif num == 8:

     canvas = Canvas(v1, width=300, height=200, bg='white')
     canvas.pack(expand=YES, fill=BOTH)
     canvas.create_polygon(40, 40, 40, 140, 140, 140, 140, 100,fill="lightblue", outline="brown", width=6)
     b3 = Button(canvas, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)

     v1.deiconify()
    elif num == 9:

     canvas = Canvas(v1, width=300, height=200, bg='white')
     canvas.pack(expand=YES, fill=BOTH)
     canvas.create_polygon(420,180,
                           420,60,
                           380,100,
                           300,100,
                           260,60,
                           260,140,
                           220,100,
                           180,100,
                           140,140,
                           140,80,
                           150,80,
                           200,40,
                           200,20,
                           160,20,
                           90,80,
                           100,160,
                           120,270,
                           200,270,
                           200,230,
                           160,230,
                           160,210,
                           180,190,
                           220,190,
                           220,270,
                           280,270,
                           280,230,
                           260,230,
                           260,180,
                           400,200,
                           360,220,
                           320,220,
                           280, 180,
                           fill="lightblue", outline="brown", width=6)
     b3 = Button(canvas, text="ocultar", command=lambda: ejecutar(ocultar(v1)))
     b3.grid(row=1, column=3)

     v1.deiconify()

def ocultar(ventana):ventana.destroy()
def ejecutar(f): v0.after(200, f)
b1 = Button(v0, text="Abrir ventana con Circulo", command=lambda: ejecutar(mostrar(1)) )
b1.grid(row=1, column=1)
b3 = Button(v0, text="Abrir ventana con cuadrado", command=lambda: ejecutar(mostrar(2)))
b3.grid(row=1, column=2)
b3 = Button(v0, text="Abrir ventana con linea", command=lambda: ejecutar(mostrar(3)))
b3.grid(row=1, column=3)
b4 = Button(v0, text="Abrir ventana con arco", command=lambda: ejecutar(mostrar(4)))
b4.grid(row=1, column=4)
b5 = Button(v0, text="Abrir ventana con quesito", command=lambda: ejecutar(mostrar(5)))
b5.grid(row=1, column=5)
b6 = Button(v0, text="Abrir ventana con quesito y arco", command=lambda: ejecutar(mostrar(6)))
b6.grid(row=1, column=6)
b7 = Button(v0, text="Abrir ventana con texto", command=lambda: ejecutar(mostrar(7)))
b7.grid(row=1, column=7)
b8 = Button(v0, text="Abrir ventana con poligono", command=lambda: ejecutar(mostrar(8)))
b8.grid(row=1, column=8)
b9 = Button(v0, text="Abrir ventana con poligono 2", command=lambda: ejecutar(mostrar(9)))
b9.grid(row=1, column=9)

v0.mainloop()

No hay comentarios:

Publicar un comentario