create a normal plane passing through a point P knowing the coordinates of the direction of the Normal vector to point P

5 次查看(过去 30 天)
HI! Is there a way to create a plane normal to a coordinate of a 'line_test' matrix (e.g. the 'P' coordinate)?
If it can be useful I have the coordinates of the direction of the Normal vector to point P ('normal_test').
line_test = importdata("line_test_1.mat");
figure
plot3(line_test(:,1),line_test(:,2),line_test(:,3),'r.','Markersize',10);
axis equal
P = line_test(10,:);
normal_test = importdata("normal_test.mat");

采纳的回答

Matt J
Matt J 2023-9-23
a=normal(1); b=normal(2); c=normal(3);
d=dot(normal,P);
fimplicit3(@(x,y,z) a*x+b*y+z*c-d )
  2 个评论
Alberto Acri
Alberto Acri 2023-9-24
编辑:Bruno Luong 2023-9-24
Hi @Matt J! I think the lines of code you sent me are wrong ('normal' is missing). I tried this again and it works! I changed the 'line' and 'normal' matrix.
line = importdata("line_w.mat");
normal = importdata("normal_w.mat");
row = 10; % variabile
P = line(row,:);
plane = normal(row,:);
a=plane(1); b=plane(2); c=plane(3);
d=dot(plane,P);
figure
plot3(line(:,1),line(:,2),line(:,3),'r.','Markersize',10);
hold on
plot3(P(:,1),P(:,2),P(:,3),'b.','Markersize',15);
fimplicit3(@(x,y,z) a*x+b*y+z*c-d)
hold off
axis equal
xlabel('x')
ylabel('y')
zlabel('z')
xlim([0 50])
ylim([-50 20])

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by