Question: How to write the equation of the line in the form a x+ b y + c = 0 with igcd(a,b,c)=1 and a >0?

I want to write the equation of the line in the form a*x + b*y + c=0, with igcd(a,b,c)=1 of this code

restart;
with(geometry);
point(A, 2, -3);
point(B, -1, 6);
sort(Equation(line(d, [A, B], [x, y])));

I tried by hand

-1/3*sort(Equation(line(d, [A, B], [x, y])))

How can I get the result 3x + y - 3=0 automatically?

PS. I tried and get the answer 3x + y - 3 =0.

restart;
with(geometry);
point(A, 2, -3);
point(B, -1, 6);
eq := sort(Equation(line(AB, [A, B], [x, y])));
k := igcd(coeff(lhs(eq), x), coeff(lhs(eq), y));
sort(eq*sign(coeff(lhs(eq), x))/k);

 

Please Wait...