Intersection of Surfaces via Groebner Basis Computation 

> restart;
 

> eq[1] := x^2 + y^2 + z^2 = 1;
 

x^2+y^2+z^2 = 1 

> eq[2] := x^2 + y^2 + z^2 = 2*x;
 

x^2+y^2+z^2 = 2*x 

> eq[3] := 2*x - 3*y = z;
 

2*x-3*y = z 

 

Use plots to see the surfaces represented by these equations in 3-dimensional space. 

 

> with(plots):
 

> implicitplot3d(eq[1], x=-1..1, y=-1..1, z=-1..1, axes=boxed);
 

Plot 

 

> implicitplot3d(eq[2], x=-1..1, y=-1..1, z=-1..1, axes=boxed);
 

Plot 

 

> implicitplot3d(eq[3], x=-1..1, y=-1..1, z=-1..1, axes=boxed);
 

Plot 

 

The following command shows all three surfaces in one plot. 

By dragging with the mouse, you can rotate the plot to see different views. 

 

> implicitplot3d([eq[1],eq[2],eq[3]], x=-1..1, y=-1..1, z=-1..1,
  axes=boxed, color=[red,blue,yellow]);
 

Plot 

>
 

Problem: 

Find the points of intersection of these three surfaces by using a Groebner basis computation.  Show the Groebner basis that you computed, show the intersection points in explicit form in terms of radicals, and also apply    to show the points in floating-point form. 

 

> F := [seq(lhs(eq[i])-rhs(eq[i]), i = 1..3)];
 

[x^2+y^2+z^2-1, x^2+y^2+z^2-2*x, 2*x-3*y-z] 

> G := Groebner:-Basis(F, plex(x,y,z));
 

[40*z^2-8*z-23, 3*y+z-1, 2*x-1] 

> _EnvExplicit := true;
 

true 

> soln := solve(G, [x,y,z]);
 

[[x = 1/2, y = 3/10-1/20*26^(1/2), z = 1/10+3/20*26^(1/2)], [x = 1/2, y = 3/10+1/20*26^(1/2), z = 1/10-3/20*26^(1/2)]]
[[x = 1/2, y = 3/10-1/20*26^(1/2), z = 1/10+3/20*26^(1/2)], [x = 1/2, y = 3/10+1/20*26^(1/2), z = 1/10-3/20*26^(1/2)]]
 

> evalf(soln);
 

[[x = .5000000000, y = 0.450490243e-1, z = .8648529271], [x = .5000000000, y = .5549509757, z = -.6648529271]]
[[x = .5000000000, y = 0.450490243e-1, z = .8648529271], [x = .5000000000, y = .5549509757, z = -.6648529271]]
 

>