Plot a rolling disk

14 ビュー (過去 30 日間)
Abhishek Tyagi
Abhishek Tyagi 2021 年 4 月 16 日
コメント済み: Image Analyst 2021 年 4 月 16 日
1.1. Write MATLAB Script to animate the motion of the rolling disk for two complete rotations, showing (as a trace) the trajectory of the point on the rim. Take: radius of the disk equal to 10 units, radius of the point is also equal to 10 units. An example is presented below.
1.2 Produce a static plot for your system, showing the rim point's speed using the "quiver" command. An example is presented below.
r=10;y=10;
figure
t=0:pi/64/pi;
th = 0:pi/50:2*pi;
yline(0)
hold on
for x=-128:4:0
xp=r*cos(th)+x;
yp=r*sin(th)+y;
plot(xp,yp)
pause(0.1)
end
axis([-140 10 -40 60])
set(gca,'xtick',[-120:20:0])
set(gca,'ytick',[-50:10:70])
hold off`
  3 件のコメント
Geoff Hayes
Geoff Hayes 2021 年 4 月 16 日
Abhishek - what have you tried so far? This looks like homework, so please discuss what you have attempted (showing code where necessary) and ask a specific question about what you don't understand or what errors you are observing with your code.
Abhishek Tyagi
Abhishek Tyagi 2021 年 4 月 16 日
編集済み: Abhishek Tyagi 2021 年 4 月 16 日
i am not getting how to place trace points on rolling circles. Also how to calculate X and Y coordinates of points to be ploted

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2021 年 4 月 16 日
Use a line style that places markers at each point, like 'b.-':
plot(xp, yp, 'b.-', 'MarkerSize', 15, 'LineWidth', 1)
  2 件のコメント
Abhishek Tyagi
Abhishek Tyagi 2021 年 4 月 16 日
編集済み: Abhishek Tyagi 2021 年 4 月 16 日
it will plot only circles, point showing rotation also has to be plotted
Image Analyst
Image Analyst 2021 年 4 月 16 日
Then get rid of the dot and lot short line segments using plot() or line() (like tick marks along the curved line). You just need to determine the endpoints of the line but that should be easy for you.

サインインしてコメントする。

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by