C++ Implementation of Visvalingam's simplification algorithm