Ask Your Question

Revision history [back]

The way I understand the question, you would like to visualize the plane given by each of the equations, and see whether they have a common intersection.

Here is one way to do that.

Define the three equations:

sage: x, y, z = SR.var('x y z')
sage: a, b, c = [2*x + 3*y - z == 15, x - 3*y + 3*z == -4, 4*x - 3*y - z == 19]

and the range of x, y, z where you want to plot:

sage: xx = (x, -10, 10)
sage: yy = (y, -10, 10)
sage: zz = (z, -10, 10)

Define the plots of the three planes, with different colors:

sage: pa = implicit_plot3d(a, xx, yy, zz, color='blue', alpha=0.3)
sage: pb = implicit_plot3d(b, xx, yy, zz, color='red', alpha=0.3)
sage: pc = implicit_plot3d(c, xx, yy, zz, color='green', alpha=0.3)
sage: p = a + b + c

Then you can show the combined plot using various viewers:

sage: p.show(aspect_ratio=1, viewer='jmol')
Launched jmol viewer for Graphics3d Object

sage: p.show(aspect_ratio=1, viewer='threejs')
Launched html viewer for Graphics3d Object

sage: p.show(aspect_ratio=1, viewer='tachyon')
Launched png viewer for Graphics3d Object

It seems that the threejs viewer does not take into account the opacity setting given by the alpha option.

In the "SageNB" notebook you have an extra viewer available:

sage: p.show(aspect_ratio=1, viewer='canvas3d')
Launched png viewer for Graphics3d Object

The way I understand the question, you would like to visualize the plane given by each of the equations, and see whether they have a common intersection.

Here is one way to do that.

Define the three equations:

sage: x, y, z = SR.var('x y z')
sage: a, b, c = [2*x + 3*y - z == 15, x - 3*y + 3*z == -4, 4*x - 3*y - z == 19]

and the range of x, y, z where you want to plot:

sage: xx = (x, -10, 10)
sage: yy = (y, -10, 10)
sage: zz = (z, -10, 10)

Define the plots of the three planes, with different colors:

sage: pa = implicit_plot3d(a, xx, yy, zz, color='blue', alpha=0.3)
sage: pb = implicit_plot3d(b, xx, yy, zz, color='red', alpha=0.3)
sage: pc = implicit_plot3d(c, xx, yy, zz, color='green', alpha=0.3)
sage: p = a + b + c
pa + pb + pc

Then you can show the combined plot using various viewers:

sage: p.show(aspect_ratio=1, viewer='jmol')
Launched jmol viewer for Graphics3d Object

sage: p.show(aspect_ratio=1, viewer='threejs')
Launched html viewer for Graphics3d Object

sage: p.show(aspect_ratio=1, viewer='tachyon')
Launched png viewer for Graphics3d Object

It seems that the threejs viewer does not take into account the opacity setting given by the alpha option.

In the "SageNB" notebook you have an extra viewer available:

sage: p.show(aspect_ratio=1, viewer='canvas3d')
Launched png viewer for Graphics3d Object