Info

此问题已关闭。 请重新打开它进行编辑或回答。

how to make two other points to make a plane?

1 次查看(过去 30 天)
Sierra
Sierra 2022-6-25
关闭: Matt J 2022-6-25
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.

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by