教科书上画的平面三维图形实在不容易看清楚。。。自己画个三维的左看看右看看好了。。。。
晶面指数为(221)
代码:
clc
clear all
close all
face=[2,2,1];
face=1./face;
face=face./max(face);
[x,y]=meshgrid(linspace(0,1,100));
z=face(3)*(1-x./face(1)-y./face(2));
z(z<0)=NaN;%cut those outside
figure(1);
clf;
surf(x, y, z, ...
'FaceColor', 'yellow', 'EdgeColor', 'none','FaceAlpha', 0.75);
%set EdgeColor as none, then there is no mesh lines
axis([0,1,0,1,0,1]);%cubic
%set(gcf, 'Color', 'w');%set the background color
set(gca, 'XTick', [0,face(1)], 'YTick', [0,face(2)], 'ZTick', [0,face(3)],...
'Box', 'on','DataAspectRatio', [1, 1, 1], 'Projection', 'perspective');
%DataAspectRatio change the ratio of axis
%camlight headlight;
lighting gouraud;
view(124,26)
显示结果:
注:如果晶面系数有负的,这个代码暂时还不能处理
参考:
已知三点,matlab求平面方程
http://zhidao.baidu.com/link?url=6sFS_FWmWUKyHypSklCKi_JmkSbvbqEYoTI4je0FOXVfN8isTuHHntHVc6P74OHY1DT4W48PhqUP7a4iEoPc6q
用matlab求一组数的最简整数比
http://zhidao.baidu.com/link?url=OmTFEkOHYkNmHFb7vx4I1QN6v2GBvfd07-0QMy8tNYgpaPrmGMmxfAFY04X_zhBTIRTLy9Nbg3TNQtOh3PNlZq
求用MATLAB判断两数是否互质
http://tieba.baidu.com/p/2414390012
三个分数比怎样求最简整数比
http://zhidao.baidu.com/link?url=lFDKkW-Qd3SAG4tFPak38hCbUSILkuER9l3KauOyxsHNnln96Pz8PUGbYMYq2HIJ4BeL6Ua73Q9-8FHAxizlOq
matlab三维图剪切掉其中一部分,如何操作?
http://wenwen.soso.com/z/q365951906.htm