How to optimize the formula calculation of distance from point to line?

Enter the coordinates of the point (m, n) and the straight line equation A x + B y + c == 0

pal = {m, n, A x + B y + c == 0}

Extract the Abscissa and ordinate values of a point respectively

xc = pal[[1]]

yc = pal[[2]]

pol = Apply[Subtract, pal, {1}]

Extract the coefficients before x, the coefficients before y and the constant term in the input linear equation, respectively.

xt = Coefficient[pol, x, 1][[3]]

yt = Coefficient[pol, y, 1][[3]]

ct = Coefficient[Coefficient[Coefficient[pol, x, 0], x, 0][[3]], y, 0]

The result of calculating the distance from the input point to the input line using the distance formula from point to line,Put the previously extracted value into the formula to get the distance value.

distance = Abs[xc xt + yc yt + ct]/Sqrt[xt^2 + yt^2]

How do I optimize this code?

The following is an example of the calculation.

The distance from a point (3,4) to a straight line 3 x - 2 y + 1 == 0

pal = {1, 2, a x - y + 4 == 0};

xc = pal[[1]];

yc = pal[[2]];

pol = Apply[Subtract, pal, {1}];

xt = Coefficient[pol, x, 1][[3]];

yt = Coefficient[pol, y, 1][[3]];

ct = Coefficient[Coefficient[Coefficient[pol, x, 0], x, 0][[3]], y, 0];

distance = Abs[xc xt + yc yt + ct]/Sqrt[xt^2 + yt^2]

There is no need to repost virtually identical questions.