Filter löschen
Filter löschen

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

5 Ansichten (letzte 30 Tage)
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");

Akzeptierte Antwort

Matt J
Matt J am 23 Sep. 2023
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 Kommentare
Alberto Acri
Alberto Acri am 24 Sep. 2023
Bearbeitet: Bruno Luong am 24 Sep. 2023
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])
Alberto Acri
Alberto Acri am 24 Sep. 2023
Hi @Matt J! Can I ask you if it is possible to generate a plan of limited dimensions, for example a 10x10 square?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by