how to plot a plane using equations of planes?
Show older comments
I want to plot a plane using normal vecotr which is perpendicular to a plane.
my data is lon,lat,alt data(3D).
I used this code to plot a plane to which normal vector is perpendicular.
A = mean_trajectory(1).Longitude - mean_trajectory(2).Longitude;
B = mean_trajectory(1).Latitude - mean_trajectory(2).Latitude;
C = mean_trajectory(1).Altitude - mean_trajectory(2).Altitude;
D = -(A*mean_trajectory(2).Longitude + B*mean_trajectory(2).Latitude + C*mean_trajectory(2).Altitude);
x1 = linspace(126.6042,126.5995,10); % I manually limited the x axis and y axis.
y1 = linspace(37.2995,37.3048,10);
[x y] = meshgrid(x1,y1);
z = -1./C * (A.*x + B.*y + D);
surf(x,y,z)
but the result seems to be something wrong especially the 'z' value(alt).


I think it should be slightly titled. but it's not.
I draw what i want to make for your understanding.

left is what i want to draw and right is what i plotted so far.
If you more clarficiation, just tell me
Thanks!
Accepted Answer
More Answers (1)
Sai Charan Sampara
on 22 Jun 2022
0 votes
For a given set of points or vector , the plane that is passing through them is always unique. So if the points that are being plotted in the surface plot are correct then the plane that has been plotted is the one you are looking for. From what I can understand you have made a plane passing through the point mean_trajectory(2) and perpendicular to the vector mean_trajectory(1)-mean_trajectory(2).If you are expecting the plane to also pass through mean_trajectory(1), it will not happen. Hence the z value will not reach 3.3584e3. If you want the point to be in the middle of the plotted plane just change the values of x1,y1 such that the required point is inside that range.Try
ThemeCopy
x1 = linspace(120,130,10);
y1 = linspace(30,40,10);
If I misunderstood your question , clarify it a bit more regarding what exactly you are looking for.
3 Comments
Sierra
on 22 Jun 2022
Sierra
on 22 Jun 2022
Sai Charan Sampara
on 23 Jun 2022
After changing the limits on x1,y1 the surface seems to be perpendicular to the line joining the 2 trajectory points. I have attached a screen shot below.

Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






