3D plane plotting restricted by 3 points

조회 수: 44 (최근 30일)
RAJ SINGH
RAJ SINGH 2018년 7월 8일
편집: Anton Semechko 2020년 11월 2일
how can plot a 3D plane restricted among 3 points...???.I mean the plane should be restricted by 3 lines formed by those 3 points
  댓글 수: 2
RAJ SINGH
RAJ SINGH 2018년 7월 9일
Thanks alot man...your code worked... Can you even tell me that what changes I should implement if I need to do the same work but with 4 3D points which are co-planar, i.e. plotting a plane restricted by four 3D points which are co-planar.
Anton Semechko
Anton Semechko 2018년 7월 9일
편집: Anton Semechko 2018년 7월 9일
There no significant changes required as you would still be using the 'patch' function. Examples of using 'patch' to plot quadrilaterals in xy-plane given in function documentation, but you would use exactly the same syntax to plot "3D" quadrilaterals.

댓글을 달려면 로그인하십시오.

채택된 답변

Anton Semechko
Anton Semechko 2018년 7월 8일
Equation of a plane is determined uniquely by any 3 (noncollinear) points lying on the plane. Based on your question, it sounds like you dont care about equation of the plane and just want to visualize region of a plane enclosed by 3 points (i.e., a triangle). Here is an example of how to do this:
% Vertex coordinates
p1=[0 0 0];
p2=[2 0 0];
p3=[1 sqrt(3/2) sqrt(3/2)];
% Plot trianle using 'patch'
figure('color','w')
h=patch('Faces',1:3,'Vertices',[p1;p2;p3]);
set(h,'FaceColor','r','EdgeColor','k','LineWidth',2,'FaceAlpha',0.5)
axis equal vis3d
view([30 30])
xlabel('x','FontSize',20)
ylabel('y','FontSize',20)
zlabel('z','FontSize',20)
  댓글 수: 2
Antonina Moskal
Antonina Moskal 2020년 10월 31일
i am new at this so i might sound stupid asking this question but can we plot these points using other functions other than patch(), i mean like what about ezmesh, or fsurf , etc...??
Anton Semechko
Anton Semechko 2020년 11월 2일
편집: Anton Semechko 2020년 11월 2일
'patch' function is a general-purpose suraface visualization function. The functions you listed only work for surfaces parameterized over rectangular domains.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by