If a line with slope a (in the plane) is reflected through another line with slope b, then the image line has slope c,
where c = (a*b^2-a+2*b)/(-b^2+1+2*b*a).

In this GeoGebra worksheet, the blue line is the reflected image of the red line through the black line. Adjust the sliders to change the slopes of the lines.