(self, tree, parent_square, node, weight)
return self.pythagoras_tree(tree, node, square)
Compute all the properties for a single child.

        Parameters
        ----------
        tree : TreeAdapter
            A tree adapter instance where the original tree is stored.
        parent_square : Square
            The parent square of the given child.
        node : int
            The node label of the child.
        weight : float
            The weight of the node relative to its parent e.g. two children in
            relation 3:1 should have weights .75 and .25, respectively.

        Returns
        -------
        TreeNode
            The tree node representation of the given child with the computed
            subtree.
Compute all the properties for a single child.
Compute all the properties for a single child .
def _compute_child(self, tree, parent_square, node, weight):
        """Compute all the properties for a single child.

        Parameters
        ----------
        tree : TreeAdapter
            A tree adapter instance where the original tree is stored.
        parent_square : Square
            The parent square of the given child.
        node : int
            The node label of the child.
        weight : float
            The weight of the node relative to its parent e.g. two children in
            relation 3:1 should have weights .75 and .25, respectively.

        Returns
        -------
        TreeNode
            The tree node representation of the given child with the computed
            subtree.

        """
        # the angle of the child from its parent
        alpha = weight * pi
        # the child side length
        length = parent_square.length * sin(alpha / 2)
        # the sum of the previous anlges
        prev_angles = sum(self._slopes[parent_square])

        center = self._compute_center(
            parent_square, length, alpha, prev_angles
        )
        # the angle of the square is dependent on the parent, the current
        # angle and the previous angles. Subtract PI/2 so it starts drawing at
        # 0rads.
        angle = parent_square.angle - pi / 2 + prev_angles + alpha / 2
        square = Square(center, length, angle)

        self._slopes[parent_square].append(alpha)

        return self.pythagoras_tree(tree, node, square)
def _compute_child ( self , tree , parent_square , node , weight ) : # the angle of the child from its parent alpha = weight * pi # the child side length length = parent_square . length * sin ( alpha / 2 ) # the sum of the previous anlges prev_angles = sum ( self . _slopes [ parent_square ] ) center = self . _compute_center ( parent_square , length , alpha , prev_angles ) # the angle of the square is dependent on the parent, the current # angle and the previous angles. Subtract PI/2 so it starts drawing at # 0rads. angle = parent_square . angle - pi / 2 + prev_angles + alpha / 2 square = Square ( center , length , angle ) self . _slopes [ parent_square ] . append ( alpha ) return self . pythagoras_tree ( tree , node , square )