示例#1
0
def change_coordinates(menu, p):
    global polaire
    global v
    global long
    global vmin
    global vmax
    global vmed
    polaire = not p
    if not p:
        vmin = vminp
        vmax = vmaxp
        vmad = vmedp
    else:
        vmin = vminc
        vmax = vmaxc
        vmed = vmedc
    long = speedmod * min(longueur * 200 / vmax, longueur * 100)
    v = speedmod * dt * vitesse * 25 / vmax
    if polaire:
        disp_menu_coord = "Set Cartesian Coordinates"
        label_vx.config(text="Vr")
        label_vy.config(text="Vth")
        button_change_coord.config(text="Cartesian")
    else:
        label_vx.config(text="Vx")
        label_vy.config(text="Vy")
        disp_menu_coord = "Set Polar Coordinates"
        button_change_coord.config(text="Polar")
    menu.entryconfig(3, label=disp_menu_coord)
    fc.reset_vectors(gouttes, canvas)
    return
示例#2
0
def zoommoins():
    global fenetre
    global fenetre_initiale

    global long
    global v
    fenetre *= 2
    fenetre_initiale *= 2
    fc.reset_vectors(gouttes, canvas)
示例#3
0
def zoomplus():
    global fenetre
    global fenetre_initiale
    global long
    global v

    fenetre = np.divide(fenetre, 2)
    fenetre_initiale /= 2
    fc.reset_vectors(gouttes, canvas)
示例#4
0
def reset_figure():
    global v
    global long
    global vmin
    global vmax
    global vmed
    vminp, vmaxp, vmedp = max_relation(fenetre, True, t=t)
    vminc, vmaxc, vmedc = max_relation(fenetre, False, t=t)
    if polaire:
        vmin = vminp
        vmax = vmaxp
        vmad = vmedp
    else:
        vmin = vminc
        vmax = vmaxc
        vmed = vmedc
    long = speedmod * min(longueur * 200 / vmax, longueur * 100)
    v = speedmod * dt * vitesse * 25 / vmax
    fc.reset_vectors(gouttes, canvas)
    return
示例#5
0
reset_figure_button = Button(toolbar,
                             text="Auto Speed & Length",
                             height=1,
                             bg=bg_buttons,
                             fg=fg_buttons,
                             command=reset_figure,
                             font=ofont)
reset_figure_button.grid(row=0, column=10)

reset_vectors_button = Button(
    toolbar,
    text="Reset Vectors",
    height=1,
    bg=bg_buttons,
    fg=fg_buttons,
    command=lambda: fc.reset_vectors(gouttes, canvas),
    font=ofont)
reset_vectors_button.grid(row=0, column=11)


def change_coordinates(menu, p):
    global polaire
    global v
    global long
    global vmin
    global vmax
    global vmed
    polaire = not p
    if not p:
        vmin = vminp
        vmax = vmaxp