I made a program that graphs a figure 8 using equations, and it outputs a single curve. I have the option to change the bounds, so I can print out a half finished 8 or just a half of the 8, but I didn’t make a maximum/minimum value for the bounds, so theoretically I could make the curve draw over itself an infinite number of times.

- How do I find the self intersection of the curve?
- How do I trim of the excess so the curve doesn’t draw over itself?

Thanks!