How to alter Comet Speed

29 ビュー (過去 30 日間)
Jonathan Bird
Jonathan Bird 2020 年 2 月 6 日
回答済み: James 2025 年 2 月 18 日
I'm trying to use the comet function as a 2D animation but there does not seem to be an easy way to alter the speed at which it traces, any suggestions?

回答 (2 件)

Jim Riggs
Jim Riggs 2020 年 2 月 6 日
I don't see a way to control the speed of the comet function. There is a discussion of controlling the speed of an animated line here.

James
James 2025 年 2 月 18 日
You can alter the comet speed by changing the increment length.
For example, if
t=linspace(0,2*pi,4000);
x=cos(5*t);
y=sin(7*t);
comet(x,y)
then to slow down the tracing speed you can increase the number of intervals, e.g., from 4000 to 40 000:
t=linspace(0,2*pi,40000);
However, it appears that comet speed and increment length are not always proportional. Compare
t=linspace(0,2*pi,1000);
with the first example.
So depending on your desired result, this may work for you.

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by