Question

I want to draw two planes in same figure, how can I do this?

x + y + z = 1
2x - y + 3z = 4

Thanks!

Was it helpful?

Solution

Ranges of x and y in which to display planes:

X = linspace(-100,100,10);
Y = linspace(-100,100,10);
[ XX, YY ] = meshgrid(X,Y);

Calculating z coordinate for planes:

ZZ1 = 1 - XX - YY;
ZZ2 = 4/3 - 2/3 * XX + 1/3 *YY;

Displaying:

figure;
hold on;
mesh(XX,YY,ZZ1);
mesh(XX,YY,ZZ2);

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top