kill(all)$
\\ *appendix : circle-circle$

peter.vlasschaert@gmail.com,11/07/2017

general equation : circle 
=>      (x-a)^2+(y-b)^2=r^2
(a,b) = center of the circle.
r        = radius of the circle.

p1:(x-a1)^2+(y-b1)^2=r1^2;
p2:(x-a2)^2+(y-b2)^2=r2^2;

a) expand (p1,p2)

p3:expand(lhs(p1)-rhs(p1))=0;
p31:(-1)*p3;
p4:expand(lhs(p2)-rhs(p2))=0;

b) sum (p31+p4)

p5:p31+p4;

c) coef:  aa*x+bb*y+cc=0

aa: part(coeff(p5,x,1),1);
bb:part(coeff(p5,y,1),1);
cc:part(coeff(p5,x,0),1);

p6:aa*x+bb*y+cc=0;
p7:part(solve(p6,x),1);

d)   insert p7 in p3

p8:ev(p3,p7);

e)  y values => y1,y2

p9:solve(p8,y)$
y1:part(p9,1,2);
y2:part(p9,2,2);

f) x values =>x1,x2 (    =>  y1,y2 in  p7)

x1=part(subst(y1, y, p7),2);
x2=part(subst(y2, y, p7),2);