This is a sample C++ code from a project that converts mouse drawn lines into arc-splines. The conversion balances minimum number of segments agains the aesthetic quality of the result.
The key internal code is not included in this sample. The sample compiles & runs, although you won't see the resulting arc-splines.
Below is an sample image of the full application. The faded gray lines are drawn by hand. The blue-red-black arc-splines are computed by the algorithm. The red-blue color distinguishes each consectuive arc.
Thank you for looking through this,
Adrian