Python Forum
Moving with objects in tkinter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving with objects in tkinter
#2
There are several ways to measure the distance between two points in the plane
def distA(x1, y1, x2, y2):
    return abs(x1 - x2) + abs(y1 - y2)

def distB(x1, y1, x2, y2):
    return ((x1 - x2)**2 + abs(y1 - y2)**2)**0.5

def distC(x1, y1, x2, y2):
    return max(abs(x1 - x2), abs(y1 - y2))
Reply


Messages In This Thread
Moving with objects in tkinter - by dan789 - Dec-14-2018, 07:06 PM
RE: Moving with objects in tkinter - by Gribouillis - Dec-15-2018, 08:28 AM
RE: Moving with objects in tkinter - by dan789 - Dec-15-2018, 01:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter moving an class object with keybinds gr3yali3n 5 3,299 Feb-10-2021, 09:13 PM
Last Post: deanhystad
  [Tkinter] how to draw dynamic moving scale and potting trace point on waveform in tkinter pytho sameer_1985 0 2,042 May-31-2020, 01:52 PM
Last Post: sameer_1985

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020