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

3 vues (au cours des 30 derniers jours)
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");

Réponse acceptée

Matt J
Matt J le 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 commentaires
Alberto Acri
Alberto Acri le 24 Sep 2023
Modifié(e) : Bruno Luong le 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 le 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?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by