Plotting a Line onto a Plane along with Intersection Point using MATLAB

46 Views Asked by At

The line is given by a symmetric equation: (x-1)/2 = (y-3)/-1 = (z+1). The equation of the the plane is 3x+y+5z = 7. I have found the point of intersection to be (x=3,y=2,z=0). I now need to plot the plane, line, and point of intersection.

I wrote the following code

[x,y]= meshgrid(0:4);
z = (7 - 3*x + y)/5;
mesh(x,y,z, 'linestyle', 'none', 'facecolor', 'red'); hold on;

line = -0.5*x +3.5;
a = 3; b = 2; c = 0;

plot3(line,'b', 'LineWidth', 2);
plot3(a,b,c,'ko', 'MarkerSize', 10, 'MarkerFaceColor', 'k');

I need to make the plane using only mesh and mesh grid, and then I need to use plot3 only to plot the line and point of intersection.

Can someone please help me out with this

0

There are 0 best solutions below