Garfield and Odie are situated at (0,0) and (25,0), respectively. Suddenly, Garfield and Odie dash in the direction of the point (9, 12) at speeds of 7 and 10 units per minute, respectively. During this chase, find the minimum distance between Garfield and Odie.
Odie reaches (9,12) at 2 minutes, when Garfield is still 1 unit away, the closest they have been to that point. If Odie stops there, Garfield's distance from him will decrease until Garfield and Odie are both at (9,12).
If, however, neither stops at (9,12), their closest approach will be at 2.047 minutes, when they'll be 0.8192 units apart.
time separation Garfield Odie
x y x y
1.993 1.0513 8.37 11.16 9.06 11.96
1.994 1.0437 8.37 11.17 9.05 11.96
1.995 1.0362 8.38 11.17 9.04 11.97
1.996 1.0288 8.38 11.18 9.03 11.98
1.997 1.0214 8.39 11.18 9.02 11.98
1.998 1.0142 8.39 11.19 9.02 11.99
1.999 1.0070 8.40 11.19 9.01 11.99
2.000 1.0000 8.40 11.20 9.00 12.00 Odie at (9,12)
2.001 0.9931 8.40 11.21 8.99 12.01
2.002 0.9862 8.41 11.21 8.98 12.01
2.003 0.9795 8.41 11.22 8.98 12.02
2.004 0.9728 8.42 11.22 8.97 12.02
2.005 0.9663 8.42 11.23 8.96 12.03
. . .
2.044 0.8200 8.58 11.45 8.65 12.26
2.045 0.8196 8.59 11.45 8.64 12.27
2.046 0.8193 8.59 11.46 8.63 12.28
2.047 0.8192 8.60 11.46 8.62 12.28 Least separation
2.048 0.8193 8.60 11.47 8.62 12.29
2.049 0.8196 8.61 11.47 8.61 12.29
2.050 0.8201 8.61 11.48 8.60 12.30
. . .
2.138 1.3804 8.98 11.97 7.90 12.83
2.139 1.3903 8.98 11.98 7.89 12.83
2.140 1.4001 8.99 11.98 7.88 12.84
2.141 1.4101 8.99 11.99 7.87 12.85
2.142 1.4200 9.00 12.00 7.86 12.85 Garfield at (9,12)
2.143 1.4300 9.00 12.00 7.86 12.86
2.144 1.4400 9.00 12.01 7.85 12.86
2.145 1.4501 9.01 12.01 7.84 12.87
2.146 1.4602 9.01 12.02 7.83 12.88
clearvars, clc
g0=[0,0]; o0=[25,0];
goal=[9,12];
% gy=12*gx/9;
% oy=25-16*ox/9;
gdist=norm(g0-goal);
odist=norm(o0-goal);
gspeed=7; ospeed=10;
gxspeed=gspeed*9/gdist;
oxspeed=-ospeed*16/odist;
for t=1.8:.001:2.2
gx=t*gxspeed;
gy=12*gx/9;
ox=25+t*oxspeed;
oy=(25-ox)*12/16;
d=norm([ox,oy]-[gx,gy]);
fprintf('%5.3f %6.4f %4.2f %4.2f %4.2f %4.2f \n',t,d,gx,gy,ox,oy);
end
|
Posted by Charlie
on 2025-04-28 09:07:49 |