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.

 채택된 답변

Walter Roberson
Walter Roberson 2015년 12월 10일

0 개 추천

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

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

질문:

2015년 12월 9일

댓글:

2015년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by