clear all close all clc % straight line 1 of the athletic track x1=-10:0.2:10; y1=0*x1+5; % semi-circle 1 of the athletic track theta=pi/2:-0.04:-pi/2; x2=5*cos(theta)+10; y2=5*sin(theta); % straight line 2 of the athletic track x3=10:-0.2:-10; y3=0*x3-5; % semi-circle 2 of the athletic track theta=3*pi/2:-0.04:pi/2; x4=5*cos(theta)-10; y4=5*sin(theta); % Include straight lines and semi-circles to get an entire athletic track x=[x1 x2 x3 x4]; y=[y1 y2 y3 y4]; % Two cycles of the athletic track x=[x x]; y=[y y]; % plot the athletic track plot(x,y) axis([-16,16,-6,6]) axis equal hold on for i=1:length(x) k1=fix(1.1*i); % define velocity of the 1st player (uniform velocity) if k1>length(x) k1=length(x); end h1=plot(x(k1),y(k1),'Color',[1 0 0],'Marker','o','LineWidth',5); % show location of the 1st player k2=fix(1+5*i^(0.76)); % define velocity of the 2nd player (faster at the beginning, then slower) if k2>length(x) k2=length(x); end h2=plot(x(k2),y(k2),'Color',[k2/length(x) 0 k2/length(x)],'Marker','s','LineWidth',5); % show location of the 2nd player
2022-01-02 09:03:33 3KB MATLAB 动画制作 龟兔赛跑 追逐游戏
龟兔赛跑的java实现,利用多线程做的一个小程序!~
2021-12-29 12:31:21 16KB 龟兔赛跑 赛跑 java小程序 applet
1
java多线程实现龟兔赛跑,兔子的速度比乌龟快,休息的时间比乌龟长
2021-12-28 14:46:15 1KB 龟兔赛跑
1
练习作,属于C++大学教程书上的作业题。
2021-12-25 14:27:23 2KB 指针 随机数
1
这里是免费的物理管理软件,内附word文档和安装文件
2021-12-21 14:23:10 7.59MB 物流管理
1
VisualStudio2008创建的龟兔赛跑动画多线程程序演示,C#源代码.
1
龟兔赛跑的故事..docx
2021-12-18 18:03:22 25KB
该文件实现了使用多线程来完成龟兔赛跑的例子
2021-12-18 11:53:53 2KB 多线程 龟兔赛跑例子
1
android 龟兔赛跑源码,学习android的兄弟们得好好研究研究了,东西挺不错的
2021-12-18 10:42:49 1.17MB 龟兔赛跑源码
1
龟兔赛跑——Java程序设计课程多线程部分教学设计.pdf