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

2 visualizzazioni (ultimi 30 giorni)
Alberto Acri il 23 Set 2023
Commentato: Alberto Acri il 24 Set 2023
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");
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Matt J il 23 Set 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 CommentiMostra NessunoNascondi Nessuno
Alberto Acri il 24 Set 2023
Modificato: Bruno Luong il 24 Set 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 il 24 Set 2023
Hi @Matt J! Can I ask you if it is possible to generate a plan of limited dimensions, for example a 10x10 square?

Accedi per commentare.

### Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by