用拉格朗日乘數法求條件極值
目標函式:L^2=(x-x0)^2+(y-y0)^2+(z-z0)^2
約束條件:Ax+By+Cz+D=0
F=(x-x0)^2+(y-y0)^2+(z-z0)^2+λ(Ax+By+Cz+D)
2(x-x0)+λA=0 ①
2(y-y0)+λB=0 ②
Ax+By+Cz+D=0 ④
①②移項相除:(x-x0)/(y-y0)=A/B x=A(y-y0)/B+x0
代入④:A^2(y-y0)/B+Ax0+By+C^2(y-y0)/B+Cz0+D=0
(A^2+C^2)(y-y0)/B+By-By0+Ax0+By0+Cz0+D=0
(A^2+B^2+C^2)(y-y0)/B+Ax0+By0+Cz0+D=0
(y-y0)=-(Ax0+By0+Cz0+D)*B/(A^2+B^2+C^2)
x=x0-(Ax0+By0+Cz0+D)*A/(A^2+B^2+C^2)
y=y0-(Ax0+By0+Cz0+D)*B/(A^2+B^2+C^2)
z=z0-(Ax0+By0+Cz0+D)*C/(A^2+B^2+C^2)
L^2=(Ax0+By0+Cz0+D)^2/(A^2+B^2+C^2)^2(A^2+B^2+C^2)
∴L=|Ax0+By0+Cz0+D|/√(A^2+B^2+C^2)
用拉格朗日乘數法求條件極值
目標函式:L^2=(x-x0)^2+(y-y0)^2+(z-z0)^2
約束條件:Ax+By+Cz+D=0
F=(x-x0)^2+(y-y0)^2+(z-z0)^2+λ(Ax+By+Cz+D)
2(x-x0)+λA=0 ①
2(y-y0)+λB=0 ②
Ax+By+Cz+D=0 ④
①②移項相除:(x-x0)/(y-y0)=A/B x=A(y-y0)/B+x0
代入④:A^2(y-y0)/B+Ax0+By+C^2(y-y0)/B+Cz0+D=0
(A^2+C^2)(y-y0)/B+By-By0+Ax0+By0+Cz0+D=0
(A^2+B^2+C^2)(y-y0)/B+Ax0+By0+Cz0+D=0
(y-y0)=-(Ax0+By0+Cz0+D)*B/(A^2+B^2+C^2)
x=x0-(Ax0+By0+Cz0+D)*A/(A^2+B^2+C^2)
y=y0-(Ax0+By0+Cz0+D)*B/(A^2+B^2+C^2)
z=z0-(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