Plot plane using a line and a point?

조회 수: 1 (최근 30일)
shubham kumar gupta
shubham kumar gupta 2022년 5월 23일
댓글: shubham kumar gupta 2022년 5월 23일
I have a line
x=0:450;
x1=86;y1=115;z1=11420;
x2=167;y2=70;z2=9240;
y=ones(1,451)*115;
m=(9240-11420)/(167-86); %z2-z1/x2-x1
z = m*(x - x1) + z1;
hold on;line(x,y,z)
how to plot plane using this line and a point (x2,y2,z2)?
  댓글 수: 1
Torsten
Torsten 2022년 5월 23일
편집: Torsten 2022년 5월 23일
z = m*(x - x1) + z1;
in 3d is a plane, not a line.
You need two points in this plane to fix a line.
I guess that one of the points you have in mind is (x1,y1,z1).
What is the second point ?

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

채택된 답변

Matt J
Matt J 2022년 5월 23일
편집: Matt J 2022년 5월 23일
x1=86;y1=115;z1=11420;
x2=167;y2=70;z2=9240;
x3=167;y3=115;z3=9240;
p=null([x1,y1,z1,1; ...
x2,y2,z2,1; ...
x3,y3,z3,1]);
range=[ 80 180 60 120 9000 11500];
fimplicit3(@(x,y,z) p'*[x;y;z;ones(size(z))],...
range,'EdgeColor','none','FaceColor','g');
xlabel X, ylabel Y, zlabel Z, view(25,10)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by