i am using the following method in python to get the X,Y corordinates at any given this
data = display.Display().screen().root.query_pointer()._data
x = data["root_x"]
y = data["root_y"]
z = time.time()
I want to calculate the mouse speed over a given time, is there any way i can calculate and show mouse speed in miles per hour???
krisdigitx
i now managed to fix the problem and calculated the speed between the last two known x and y positions using this method
dx = float(x) - float(a1)
dy = float(y) - float(b1)
dist = math.sqrt( math.pow(dx,2) + math.pow(dy,2))
dz = float(z) - float(c1)
speed = float(dist/dz)
now what rule should i follow to convert the speed to miles per hour?? thanks for all your help, this is the output in realtime..
speed = 1512.53949852 Time = 4:30:690187 CPUTime = 1312531470.7 X = 701 Y = 600 PX = 692 PY = 605 PT = 1312531470.69
speed = 0.0 Time = 4:30:697020 CPUTime = 1312531470.7 X = 701 Y = 600 PX = 701 PY = 600 PT = 1312531470.7
speed = 1563.45505256 Time = 4:30:703667 CPUTime = 1312531470.73 X = 734 Y = 586 PX = 701 PY = 600 PT = 1312531470.7
speed = 0.0 Time = 4:30:726614 CPUTime = 1312531470.73 X = 734 Y = 586 PX = 734 PY = 586 PT = 1312531470.73
speed = 882.257032576 Time = 4:30:735274 CPUTime = 1312531470.76 X = 753 Y = 580 PX = 734 PY = 586 PT = 1312531470.73
speed = 0.0 Time = 4:30:756930 CPUTime = 1312531470.76 X = 753 Y = 580 PX = 753 PY = 580 PT = 1312531470.76
speed = 363.108272412 Time = 4:30:764397 CPUTime = 1312531470.79 X = 762 Y = 580 PX = 753 PY = 580 PT = 1312531470.76
speed = 373.79057125 Time = 4:30:789201 CPUTime = 1312531470.8 X = 765 Y = 580 PX = 762 PY = 580 PT = 1312531470.79
speed = 92.0338354526 Time = 4:30:797211 CPUTime = 1312531470.82 X = 767 Y = 580 PX = 765 PY = 580 PT = 1312531470.8
speed = 0.0 Time = 4:30:818938 CPUTime = 1312531470.83 X = 767 Y = 580 PX = 767 PY = 580 PT = 1312531470.82
speed = 46.9571214259 Time = 4:30:826073 CPUTime = 1312531470.85 X = 767 Y = 579 PX = 767 PY = 580 PT = 1312531470.83
speed = 0.0 Time = 4:30:847362 CPUTime = 1312531470.85 X = 767 Y = 579 PX = 767 PY = 579 PT = 1312531470.85