You could make different algorithms for various effects for drawing. Mirroring is a straight-forward and visually nice looking algorithm. In the example below, the canvas is mirrored vertically in the middle.
Can you modify the example to use line-function instead of point? You’ll need to use pmouseX and pmouseY variables and do the same mirror calculations to those values too.