In 2D plane, I have a point and a line. How to get the mirror point along this line?
The details depend on how your line is represented. If you represent it as an arbitrary point P on the line together with a unit column vector n along the line, then the mirror point Q' to any point Q is given by:
Q' = Q + 2(I - nnT)(P - Q)
(Here, I is the 2x2 identity matrix, nT is the transpose of n (treating n as a 2x1 matrix), and nnT is the 2x2 matrix formed by standard matrix multiplication of n with nT.) It's not too hard to show that Q' will not change if you move P anywhere on the line.
It's not hard to convert other line representations into a point/unit vector representation.