@simplify_lang_v(nim, tol:numeric, n:numeric)


build a new simpler nim by aggregating breakpoints using a Lang polyline simplification algorithm with tolerance tol and sequence size n.

In the simplification process, a breakpoint is assimilated to a d dimensional point for a nim with dimension d (in other words, the x part of the breakpoint is not taken into account). This is the case for all nim simplification functions that end with a _t.

The Lang simplification algorithm examines a sequence of such points of a fixed length n (i.e., n successive breakpoints). The first and last points of that sequence specify a segment. This segment is used to calculate the perpendicular distance to each intermediate breakpoints. If any calculated distance is larger than the specified tolerance, the search region will be shrunk by excluding its last point. This process will continue until all calculated distances fall below the specified tolerance, or when there are no more intermediate breakpoints. All intermediate brakpoints are removed and a new search sequence is defined starting at the last point from old search region. This process is illustrated below.