Plotting a normal vector to a plane in matlab

后端 未结 1 1259
广开言路
广开言路 2020-12-22 07:20

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)

相关标签:
1条回答
  • 2020-12-22 07:48

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

    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.

    0 讨论(0)
提交回复
热议问题