Velocity vs Time data while drawing with mouse pointer

Hi everyone. I will be very grateful for any opinion on my matter:
Briefly, I need to calculate velocity over time, while drawing a circle. For instance I start to draw the circle with constant velocity and subsequently slow down. I have to draw some kind of a graph attached.
It doesn't always have to be circle but the curve i draw should have continuity and non-linearity. I can write the code for polygons using the start and finish coordinates of the straight lines with tic-toc function. However for continuous curves, i unfortunately have no idea.
All help would be so appreciated.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 10 de Dic. de 2015
This does not record the time of the events, but you can ask for the current time when the event is serviced; it will be a bit inaccurate though.
Once you have the points and the time, you can calculate point-to-point distance using Euclidean distance calculations. That will not give you velocity as you need at least one further point in order to calculate relative direction. I notice, however, that in your question you are not plotting velocity, you are plotting instantaneous speed. (Remember: velocity is a vector, a direction and magnitude pair, not just magnitude.)

1 comentario

Adelante
Adelante el 10 de Dic. de 2015
Dear Walter Roberson,
Thank you for your rapid reply. The graph was an example to simplify the question, I actually need to record coordinates for very short time interval, therefore your second suggestion would work, I suppose.
Regards

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Centro de ayuda y File Exchange.

Preguntada:

el 9 de Dic. de 2015

Comentada:

el 10 de Dic. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by