早教吧作业答案频道 -->其他-->
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 曲线到定点距离...的网友还看了以下:
已知函数f(x)=13x3−ax2+1(a∈R).(Ⅰ)若曲线y=f(x)在(1,f(1))处的切 2020-04-27 …
已知v1,v2为数域K上的线性空间V的两个线性子空间,w={ax+by|x属于V1,y属于V2}、 2020-05-13 …
已知直线l被两条直线:3x+y-6=0和3x+y+3=0所截的线段长为3,且过点(1,0),求直线 2020-05-17 …
这样的二元函数可积吗?有这样一个函数:f(x,y)=[sin(x-y)]/(x-y)显然它在直线x 2020-07-25 …
有一在原点处与x轴相切并在第一象限的光滑曲线,P(x,y)为曲线上的任一点.设曲线在原点与P点之间 2020-07-26 …
求适合下列条件的双曲线的标准方程.(1)两条准线间距离为8/3,离心率为3/2,且虚轴在y轴上;( 2020-07-30 …
高考已知函数f(x)=a(x-1)/x^2,其中a>0求函数f(x)的单调区间.若直线x-y-1= 2020-08-02 …
已知曲线f(x)=ex-ax,其中e为自然对数的底数.(1)若曲线f(x)=y在x=0处的切线与直 2020-08-02 …
设x、y、z是空间不同的直线或平面,对下列五种情形:①x、y、z均为直线;②x、y是直线,z是平面; 2021-01-19 …
1、函数y=2+6x-x^3的拐点是?2、曲线y=√x在x=1处的切线斜率是?,切线方程是?3、设曲 2021-02-01 …