how to project trajectories on a plane which is made from normal vector?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello Everyone, I have trouble projecting trajectories on a plane.
First, there are a lot of trajectories which is consist of data(longitude, latitude, altitude) and I calculated the mean of longitude data, latitude data and altitude data.
This is aircraft's data.
This is mean trajectory's data.
And Using this data, I want to project trajectories on a plane.
The blue lines are aircraft's trajectories and the black line is a mena trajectory. (I intentionally made this image 2D to explain this easily.)
The red line is a normal vector made on mean trajectory's line and from this vector, I want to make a plane like the image below.
this is an example plane which is projected.(this plane is 3D (longitude, latitude, altitude))
Please let me know how to project a trajectory on a plane using normal vector.
Thanks and Have a Good Day!
3 Kommentare
Antworten (1)
SAI SRUJAN
am 24 Jan. 2024
Hi Sierra,
I understand that you are trying to plot a set of 3D aircraft trajectories onto a 2D plane defined by a normal vector that originates from a mean trajectory, which is calculated from the average longitude, latitude, and altitude of your data.
Construct a plane that contains the normal vector. To project your aircraft trajectories onto the desired plane using MATLAB, you'll need to perform an orthogonal projection for each point in your trajectory data.
Please follow the below code outline which constructs the desired plane, projects specified points onto it, and visualizes the results.
syms x y z;
normal_vector = [2, 3, 4];
mean_trajectory_point = [1, -1, 2];
plane_equation = normal_vector(1) * (x - mean_trajectory_point(1)) + ...
normal_vector(2) * (y - mean_trajectory_point(2)) + ...
normal_vector(3) * (z - mean_trajectory_point(3)) == 0;
plane_equation = simplify(plane_equation);
D = dot(normal_vector, mean_trajectory_point);
% Define two points of interest whose projections we want to find
intersection1 = [7/9, 7/9, 7/9];
intersection2 = [5, 43, -33];
[x, y] = meshgrid(0:5, 0:44);
% Solve for z using the plane equation
z = (-D - normal_vector(1) * x - normal_vector(2) * y) / normal_vector(3);
% Plot the plane
surf(x, y, z, 'FaceAlpha', 0.5, 'EdgeColor', 'none');
hold on;
% Plot the points of intersection
plot3(intersection1(1), intersection1(2), intersection1(3), 'ro', 'MarkerSize', 10, 'LineWidth', 2);
plot3(intersection2(1), intersection2(2), intersection2(3), 'bo', 'MarkerSize', 10, 'LineWidth', 2);
I hope this helps!
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!