Hi, welcome to a small project. Draw a line with your mousse (hold click) and release. The code will redraw your line to a straight line with an algorithm. More shapes coming soon. Circle is coming next week.
All 100% by me.