在Matlab中将法线向量绘制到平面上 [英] Plotting a normal vector to a plane in matlab

查看:507
本文介绍了在Matlab中将法线向量绘制到平面上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试绘制垂直于平面的矢量,但是它没有正常显示.这是代码

I'm trying to plot a vector normal to a plane but it doesn't show up as normal.This is the code

[X,Y]=meshgrid(-10:1:10); R=5+2*(X-4)+4*(Y-2); mesh(X,Y,R) hold quiver3(4,2,5,2,4,-1) hold off

[X,Y]=meshgrid(-10:1:10); R=5+2*(X-4)+4*(Y-2); mesh(X,Y,R) hold quiver3(4,2,5,2,4,-1) hold off

我在做什么错了?

推荐答案

向量垂直于平面.问题很可能是自动轴缩放.

The vector is normal to the plane. The problem is most likely the automatic axis scaling.

使用axis equal确保沿每个轴的数据单元长度相同.

Use axis equal to ensure that data units have the same length along each axis.

[X,Y]=meshgrid(-10:1:10);
R=5+2*(X-4)+4*(Y-2);
mesh(X,Y,R)
hold
quiver3(4,2,5,2,4,-1)
hold off
axis equal

使用适当的轴缩放比例,您的法向矢量将显示为垂直于平面.

With proper axis scaling, your normal vector will appear normal to the plane.

这篇关于在Matlab中将法线向量绘制到平面上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆