Uses the adjacency matrix to obtain the starting and ending points of the individual segments of tree intree. Option “-dA” writes the coordinates at the position of the corresponding segment in the adjacency matrix. Outputs X1, X2, Y1, Y2, Z1 and Z2 are Nx1 vectors, M is the concatenated Nx6 matrix.

TREES

Example: The 2D coordinates of all segments defined by the respective nodes in the tree

>> M = cyl_tree (sample2_tree, ‘-2d’)
(2D option prevents output of z-coordinates)

_0  _0  _0  _0
_0  _8  _0  _4
_8  17  _4  _9
17  27  _9  11
27  36  11  13
36  44  13  17
44  53  17  19
53  64  19  18
44  47  17  23
17  20  _9  18
20  23  18  27
23  27  27  33
27  36  33  37
27  31  33  44
20  29  18  20

X1  X2  Y1  Y2

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