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.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 10 Dez. 2015

0 Stimmen

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 Kommentar

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Discrete Data Plots finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by