Question: Equation of a circle

Problem. Let A(-1,5) and B(-2, -2) be two points and l: 3*x - 4*y -27 = 0. Write the equation of the circle passing through points A, B and tangent to the line l.

This is my code.

Restart: with(geometry):

point(A,-1,5):

point(B,-2,-2):

point(C,5,-3):

circle(ABC,[A,B,C],[x,y]):

sort(Equation(ABC)):

tangentpc(l, ABC,C):

sort(Equation(l)):

point(T,a,b):sys:=solve([distance(T,A) = distance(T,B), distance(T,A)=distance(T,l)],[a,b]):

w:=op(1,sys):

coordinates(point(o, rhs(op(1,w)), rhs(op(2,w)))):

v:=op(2,sys):

coordinates(point(K, rhs(op(1,v)), rhs(op(2,v)))):

Equation(circle(c1,[o,distance(o,A)],[x,y]));

Equation(circle(c2,[K,distance(K,A)],[x,y]));

 

Please comment to me. Thank you very much.

 

 

 

Please Wait...