To mirror an object in relation to an arbitrary line, you first have to find the coordinates of that object in the frame of reference of that line. For convenience, we will define a frame of reference where the X$X$ axis is colinear with the line itself and the Y$Y$ axis will be perpendicular to the line. Then, we can flip the Y coordinate in that frame of reference to obtain the mirrored point and finally we will reverse the transform from the line coordinate system and back to the global coordinate system.
To define a coordinate system, we will need to use one point the line passes through as the origin O$O$ of that coordinate system. This can be obtained easily by setting x = 0$x = 0$ or y = 0$y = 0$ in the line equation and we end up with the point {-c/a, 0}$\{-c/a, 0\}$ or {0, -c/b}$\{0, -c/b\}$. Getting the X$X$ and Y$Y$ axis of the new coordinate system is easy. The X$X$ axis vector {Xx, Xy}$\{X_x, X_y\}$ will be computed by normalizing {a, b}$\{a, b\}$ from the line equation. Then we need a perpendicular vector for the Y$Y$ axis direction. This is easily obtained by using either {-Xy, Xx}$\{-X_y, X_x\}$ or {Xy, -Xx}$\{X_y, -X_x\}$ (you can verify that by taking the dot product between X$X$ and Y$Y$ which will be zero).
Now that you have an origin and a coordinate system, let's find a mirrored point of vector P on that system. First we need to express it in the new coordinate system. This can be done by projecting P - O$P-O$ to the basis vectors X$X$ and Y$Y$, so the coordinates in the new system will be {dot((P - O), X), dot((P - O), Y)}$\{\langle(P - O), X\rangle, \langle(P - O), Y\rangle\}$. To obtain the mirrored point, we simply flip the Y coordinate. To obtain the final vector in the original space, we simply invert the first transform. The final point should be O + X * dot((P - O), X) - Y * dot((P - O), Y)$O + X\cdot\langle(P-O), X\rangle - Y\cdot\langle(P-O), Y\rangle$
I hope this helps. Probably there's a way to make theA note on notation better in stack overflow but that should do: $\langle u,v\rangle$ was used for nowdot product between vectors. $u\cdot k$ was used for product between vector and scalar