matlab 求任一点到原点的距离////可以一次计算多个点,完整程序
展开全部
希望可以帮到你,望采友枣纳
z=x^2+y^2
x+y+z=1
椭圆方程为(x+1/2)^2+(y+1/2)^2=3/2
z=1-x-y
原点到这椭圆上雀仔点的距离r=根号{x^2+y^2+z^2}
极值点坐标满足dr/dx=0
dr/好岁拆dx=[2x+2y*dy/dx+2z*dz/dx]/2r
=x+y*dy/dx+(1-x-y)*(-1-dy/dx)
=(2x+y-1)+(x+2y-1)*dy/dx
对椭圆方程求导2*(x+1/2)+2*(y+1/2)*dy/dx=0
dy/dx=-(2x+1)/(2y+1)
dr/dx=(2x+y-1)-(x+2y-1)*(2x+1)/(2y+1)
=(2x+2y-3)*(y-x)/(2y+1)
dr/dx=0,
=>
(2x+2y-3)*(y-x)=0
x=y=+(-)根号3/2-1/2
;
x+y=3/2>1(舍去)
r=根号{x^2+y^2+z^2}=根号{2x^2+4y^2}=根号{(11+(-)6*根号3)/2}
r(min)=根号{(11-6*根号3)/2}
r(max)=根号{(11+6*根号3)/2}
完
z=x^2+y^2
x+y+z=1
椭圆方程为(x+1/2)^2+(y+1/2)^2=3/2
z=1-x-y
原点到这椭圆上雀仔点的距离r=根号{x^2+y^2+z^2}
极值点坐标满足dr/dx=0
dr/好岁拆dx=[2x+2y*dy/dx+2z*dz/dx]/2r
=x+y*dy/dx+(1-x-y)*(-1-dy/dx)
=(2x+y-1)+(x+2y-1)*dy/dx
对椭圆方程求导2*(x+1/2)+2*(y+1/2)*dy/dx=0
dy/dx=-(2x+1)/(2y+1)
dr/dx=(2x+y-1)-(x+2y-1)*(2x+1)/(2y+1)
=(2x+2y-3)*(y-x)/(2y+1)
dr/dx=0,
=>
(2x+2y-3)*(y-x)=0
x=y=+(-)根号3/2-1/2
;
x+y=3/2>1(舍去)
r=根号{x^2+y^2+z^2}=根号{2x^2+4y^2}=根号{(11+(-)6*根号3)/2}
r(min)=根号{(11-6*根号3)/2}
r(max)=根号{(11+6*根号3)/2}
完
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询