calculating the speed of moving point
i receive one set of x and y coordinates. the coordinates keeps on changing randomly. the x could increase and y could decrease or vise versa.
the x and y values could stop changing suddenly.
the x and y values could start increasing/decreasing very fast or very slowly.
the x value could increase/decrease but y value could stay the same or vise versa.
the input of x and y is received when the program is executed and the new values of x and y are fed to the program while the program is executing.
what i want is to calculate the speed of that moving point(x,y) , in pixels per second.
so if the point is not moving( x and y values do not change ) the speed should be 0
if the x and y values increase/decrees very fast the speed should change accordingly e.g 1000 pixels/sec
it should work in the similar concept as the car, once the driver sits in the car and starts the engine and if he or she does not know where and how far they going the speedometer would still be showing the speed at which the car is going
i do not know what distance the x and y will cover and i do not know the time for how long the program will be executed and how long the x and y values will be changing
i hope you understand what i need and will be able to help me.
thank you very much
any help will be greatly appreciated