treestoolbox
treestoolbox copied to clipboard
ROOTANGLE_TREE function assume tree root at [0,0,0]
Hi Hermann, this is Sumit.
ROOTANGLE_TREE function assumes that tree begins at [0,0,0], which is not generally the case [X2, Y2 and Z2 values in the function are not pure displacement values for trees that are not rooted at 0,0,0].
Line 64 to 67 needs to updated or the tree needs to be translated (default to 0,0,0) as part of the ROOTANGLE_TREE function.
Otherwise angles generated for trees not beginning at [0,0,0] are nonsensical. This makes all the downstream results such as BF, K etc false.
%% just add the following after resampling in line 50
% if root is not at [0,0,0] translate the tree, so that root lies in [0,0,0]
if ~(rtree.X(1)==0 && rtree.Y(1) == 0 && rtree.Z(1) ==0 )
rtree = tran_tree(rtree);
end