Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

how to make two other points to make a plane?

1 visualizzazione (ultimi 30 giorni)
Sierra
Sierra il 25 Giu 2022
Chiuso: Matt J il 25 Giu 2022
I'm trying to use function now.
[I,check]=plane_line_intersect(n,V0,P0,P1)
% n: normal vector of the Plane
% V0: any point that belong s to the Plane
% P0: end point 1 of the segment P0P1
% P1: end point 2 of the segment P0P1
To get the normal vector, I need 3 points on the plane.
but I have only one point(4,5,7), so I made two arbitrary points. but it seems to have trouble in z value.
it only returns x and y value. all z value is zero
Here is my code.
intersection_point = [];
for i = 1:length(mean_trajectory_double)
O = [mean_trajectory_double(i,1),mean_trajectory_double(i,2),mean_trajectory_double(i,3)];
P = [mean_trajectory_double(i,1)+1,mean_trajectory_double(i,2)+1,mean_trajectory_double(i,3)-1000];
Q = [mean_trajectory_double(i,1)+2,mean_trajectory_double(i,2)+2,mean_trajectory_double(i,3)+1000];
OP = Q-O;
OQ = P-O;
normalvector = cross(OP,OQ);
for j = 1:length(RKSI_Arr_33R)
for k = 1:length(RKSI_Arr_33R(j).Latitude)-1
[I,check]=plane_line_intersect([normalvector(1) normalvector(2) normalvector(3)]...
,[mean_trajectory_double(i,1) mean_trajectory_double(i,2) mean_trajectory_double(i,3)]...
,[RKSI_Arr_33R(j).Longitude(k) RKSI_Arr_33R(j).Latitude(k) RKSI_Arr_33R(j).BAlt(k)]...
,[RKSI_Arr_33R(j).Longitude(k+1) RKSI_Arr_33R(j).Latitude(k+1) RKSI_Arr_33R(j).BAlt(k+1)]);
end
end
intersection_point = [intersection_point;I];
end
O is the point I know already and P, Q is what i made.
mean_trajectory_double(i,1) is longitude
mean_trajectory_double(i,2) is latitude
mean_trajectory_double(i,3) is altitude
I changed the P and Q's altitude several time, but it always returend zero.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by