Smoothens a branch given by consecutive 3D coordinates X, Y and Z, in usage by “smooth_tree”. This changes (shortens) the total length of the branch significantly. The amount of smoothing is parameterized by p, proportion smoothing (0 to 1, default .9), and n, number of iterations (default 10).

Method: in each triplet of consecutive points, approach the middle point toward the center of the triangle formed by the three points. (this is rather arbitrary and can be improved)

Example:
increased smoothing (x: black → white) on nine different sample branches

>> smoothbranch (X, Y, Z, (x-1)/10, x)

TREES

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License