How to plot 2 planes in GNU Octave
Question
I want to draw two planes in same figure, how can I do this?
x + y + z = 1
2x - y + 3z = 4
Thanks!
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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow