早教吧作业答案频道 -->其他-->
Matlab 曲线到定点距离最短问题已知x(t)=5t-10,y(t)=25t^2-120t+144.t在[0,4]之间,求曲线到(0,0)的最短距离.
题目详情
Matlab 曲线到定点距离最短问题
已知x(t)=5t-10,y(t)=25t^2-120t+144.
t在[0,4]之间,求曲线到(0,0)的最短距离.
已知x(t)=5t-10,y(t)=25t^2-120t+144.
t在[0,4]之间,求曲线到(0,0)的最短距离.
▼优质解答
答案和解析
You can use Matlab's symbolic package to get the minimum distance, you might need to use a little bit calculus
t = sym('t','real') % define a real symbol variable
x=5*t-10;
y=25*t.^2-120*t+144;
d = (x^2+y^2)^.5; % distance function
d1 = diff(d); % the differentiation
t1s = solve(d1); % let the differentiation equal to 0 to get the maxmin point
t1v = eval(t1s); % get the numerical evaluation
min_d = subs(d,t,t1v)
min_d =
1.3577
You can use the following code to generate a figure of illustrating the curve and the distance:
t = [0:0.001:4];
x=5*t-10;
y=25*t.^2-120*t+144;
figure(1);
hold on;
plot(x,y,'b');
axis([0 4 0 4],'square');
x=5*t-10;
d=(x.^2+y.^2).^.5;
figure(1);
hold on;
plot(x,d,'g');
t=t1v;
x=5*t-10;
y=25*t.^2-120*t+144;
plot(x,y,'r.');
plot([0 x],[0 y],'r');
plot([x x],[0 4],'--');
t = sym('t','real') % define a real symbol variable
x=5*t-10;
y=25*t.^2-120*t+144;
d = (x^2+y^2)^.5; % distance function
d1 = diff(d); % the differentiation
t1s = solve(d1); % let the differentiation equal to 0 to get the maxmin point
t1v = eval(t1s); % get the numerical evaluation
min_d = subs(d,t,t1v)
min_d =
1.3577
You can use the following code to generate a figure of illustrating the curve and the distance:
t = [0:0.001:4];
x=5*t-10;
y=25*t.^2-120*t+144;
figure(1);
hold on;
plot(x,y,'b');
axis([0 4 0 4],'square');
x=5*t-10;
d=(x.^2+y.^2).^.5;
figure(1);
hold on;
plot(x,d,'g');
t=t1v;
x=5*t-10;
y=25*t.^2-120*t+144;
plot(x,y,'r.');
plot([0 x],[0 y],'r');
plot([x x],[0 4],'--');

看了 Matlab 曲线到定点距离...的网友还看了以下:
高中圆锥曲线应用题已知椭圆的中心在原点O,短半轴的端点到其右焦点F(2,0)的距离为√10已知椭圆的 2020-03-30 …
关于鼠的英语小短文要简短些的,英语小短文最好有汉语意思关于迎奥运的也行,不过要短,简的有汉语意思一 2020-05-14 …
Matlab 曲线到定点距离最短问题已知x(t)=5t-10,y(t)=25t^2-120t+14 2020-05-17 …
关于椭圆的参数方程问题.已知椭圆X^2/A^2+Y^2/B^2=1上任意一点M(除短轴端点外)与短 2020-05-22 …
大一微观经济学习题已知生产函数Q=f(L,K)=2KL-0.5²-0.5K²,假定厂商目前处于短期 2020-06-11 …
急!数学问题已知平面直角坐标系,A,B两点的坐标分别为(2,-3),(4,-1)若P(p,0)是x 2020-06-28 …
解释下carrytheday请解释一下标题上的这个短语,看不懂.下面是这个短语所在的文章,文中的那个 2020-10-29 …
我国地大物博,自然资源数量大、种类多,但是人均占有量少,有些自然资源甚至出现短缺问题,因此保护和合理 2020-11-11 …
请根据以下四幅图画和提示词,以《乐于助人新风尚》为题,用英语写一篇100字左右的短文,主要内容为:1 2020-12-22 …
当今食品安全问题已经成为人们关注的一个话题,请你以FoodSafety(食品安全)为题并参考所给要点 2021-01-13 …