Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to calculate the speed of the moving point

  1. Aug 9, 2011 #1

    i am not a physician my self but a programmer and currently i am working on a little program that would calculate the speed of the point.
    i have no clue how far is that point going or for how long it will be traveling for.

    ok so i have a point (consisting of x and y coordinates)
    the point can move in any direction.
    can stop and start moving again.
    the point can move faster and then slow down(stop) gently or vise-versa .
    the distance is unknown.
    the travel time is unknown.
    the future direction is unknown.
    only know factor is the current or previous coordinates of that point.

    to make it clearer think of it as a computers mouse cursor. what speed is the mouse cursor moving at when you move it?

    is there a formula that could calculate the speed of that point?
    any suggestions/links or whatever information will help!! i have been stuck on this for

    please when you answer do not use physics terminology i will not be able to understand so try explaining everything like to a child :)

    p.s the speed could be anything from meter per second, pixels per millisecond or miles per hour. as long as i have some sort of formula ill apply it i guess ..:)

    thank you
    Last edited: Aug 9, 2011
  2. jcsd
  3. Aug 9, 2011 #2
    I'm no physician, either. But I do like to think of myself as a physicist:smile:
    Some simple formulae on the equations of motion can be found here: http://en.wikipedia.org/wiki/Equations_of_motion" [Broken]
    Last edited by a moderator: May 5, 2017
  4. Aug 9, 2011 #3
    You need to have time to calculate speed. If the point moved 3 pixels towards right in one second, the speed is 3 pixels per second towards right. Similarly you can have a vertical speed also, example 4 pixels upwards per second. After knowing the horizontal and vertical speeds, you need to use the Pythagoras theorem to calculate the net speed. Here it will be Squareroot(3^2 + 4^2) = Squareroot(25) = 5 pixels per second in an inclined direction.
  5. Aug 9, 2011 #4
    You need two points with 3 coordinates each: (x1,y1,t1) and (x2,y2,t2)

    sqrt((y2-y1)^2 +(x2-x1)^2)/(t2-t1)
  6. Aug 9, 2011 #5
    ok i sort of understand why i need two points so one of my points could be the 0,0 and the other point could be the point which speeds i want to track. However am i right to think that those three coordinates mean that the third coordinate would stand for the time?
    and what would be the time interval?

    i understand from the formula above if i set the time for example 1 minute and if i move the point by 50 pixels than the speed is 50pixels/min. what if i move my point by 50 pixels in 30 seconds and for the other 30 seconds i would stand still? i would still get 50pixels/min!
    which is obviously not true because this would only show the average speed of that past minute not the present speed.

    would there be a better way to solve this ?

    again any suggestions are mostly welcome
  7. Aug 9, 2011 #6
    The two coordinates are the same point, or object, but different times and locations. You need to use small time intervals to get a more accurate answer, not one minute. In the equation about the time interval is t2 - t1. So read your point's coordinates, then 1/2 a second later read them again. Plug those two sets of x,y,t coordinates in to the equation and it will give you average velocity over that half second.
  8. Aug 9, 2011 #7
    thanks for your response. i understand what you are trying to say now, thanks. nonetheless in half a second you would only be able to cover maximum of 5 pixels or so... in this case my numbers wouldn't very much most of the time it would stay max 4-5 pixels per 1/2 second if i am moving very slowly it would be around 2-3 pixels per 1/2 second. these values aren't vary significant and wouldn't make much meaning.
    longer time interval i understand would lead to more precise value, however longer time intervals would have the problem i have explained above....

    maybe there is a totally different way to calculate that velocity of the point which would be in real time not for the previous time interval...

    thank you very much for all the help
  9. Aug 9, 2011 #8
    Essentially you will need to sample it; that is, record the position at regular time intervals. It could be every second, it could be every millisecond. It depends how accurate your output needs to be.

    Regardless, you can only get an average velocity, not an average speed. The smaller time interval you choose, the more they will be the same.
  10. Aug 10, 2011 #9
    Expanding on what the king said, you need to record many samples then you can graph or average it or whatever you want. So take a reading every half second, record 120 readings for your one minute total. Then graph it.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook