我想绘制垂直于矢量的平面,并用 Matlab 穿过一个点。我的向量有坐标v1 = [2,i]
,我的点有坐标com_m1 = [1,i]
。
我都试过了:
xx=(-15:-6:0.25);
yy=(-10:-2:0.25);
for i = 1:length(xx)
for j = 1:length(yy)
zz_m1(j,i)=(v1(2,2)*(xx(i) - com1(1,1)) + v1(2,2)*(yy(j)-com1(1,2)))/v1(2,3) + com1(1,3);
end
end
surf(xx,yy,zz_m1, 'FaceColor','red','EdgeColor','none') % Plotting the surface
和
[xx, yy]=meshgrid(-15:-6:0.25,-10:-1:0.25);
zz_m1=(v1(2,2)*(xx - com1(1,1)) + v1(2,2)*(yy-com1(1,2)))/v1(2,3) + com1(1,3);
surf(xx,yy,zz_m1, 'FaceColor','red','EdgeColor','none')
但两者都没有奏效。谁能帮我理解我做错了什么?谢谢!