待解方程:
% 输入是 x_d 数据库图像的 x 坐标;y_d 查询图像的 y 坐标;a_d 查询图像的视角
% 待求未知数为 x_query,初始值设为 [30 0 0];
F=@(x_query)[(x_query(1)-x_d(1))*tan(x_query(3)-a_d(1))+(y_d(1)-x_query(2));
(x_query(1)-x_d(2))*tan(x_query(3)-a_d(2))+(y_d(2)-x_query(2));
(x_query(1)-x_d(3))*tan(x_query(3)-a_d(3))+(y_d(3)-x_query(2))];
x_query_0=[0.3 0 0];
options = optimoptions(@fsolve,'MaxFunctionEvaluations',3000,'MaxIterations',2000);
[Estimated_locazion]= fsolve(F,x_query_0,optimset('Display','iter'));
disp(Estimated_locazion);