Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Then let us solve with respect to x and z.

Essentially the same code gives the expected answer:

var( 'x, y, z, y0' )

eq1 =    x^2 + y^2 == 4
eq2 =    (y-y0)^2 + z^2 == 4

solutions = solve( [ eq1, eq2 ], [x, z] )
for solution in solutions:
    print solution

And we get:

[x == -sqrt(-y^2 + 4), z == -sqrt(-y^2 + 2*y*y0 - y0^2 + 4)]
[x == sqrt(-y^2 + 4), z == -sqrt(-y^2 + 2*y*y0 - y0^2 + 4)]
[x == -sqrt(-y^2 + 4), z == sqrt(-y^2 + 2*y*y0 - y0^2 + 4)]
[x == sqrt(-y^2 + 4), z == sqrt(-y^2 + 2*y*y0 - y0^2 + 4)]