def move_child_to_line(point, change, old_line, orientation):
    """
    A helper function that uses the triangle similarity
    theorem which specifies that if one triangle
    is just a sub triangle of another i.e. is just
    one line drawn from any two sides it's sides
    share a ratio.

    :param point: coordinate to be moved

    :type point: tuple

    :param change: amount the original line was moved
    as a length

    :type change: float

    :param old_line: original line which was moved

    :type old_line: tuple

    :param orientation: orientation of panel whose
    line was moved therefore the line

    :type orientation: str

    :return: Amount the point needs to be adjusted

    :rtype: float
    """

    # If the line was moved vertically
    if orientation == "h":

        old_line_length = old_line[1][0] - old_line[0][0]

        # change times the old point's x coordinate minus
        # the old line's second point's x coordinate
        # by the line's length

        # In essence ratio of change/oldline times the difference
        # between the point on the line's x coord i.e the length of
        # the side of the inner triangle times the changed line's length
        movement = (change*(point[0] - old_line[1][0]))/old_line_length

        return movement

    # Same as above but if the lien was moved horizontally
    else:

        old_line_length = (old_line[1][1] - old_line[0][1])

        movement = (change*(point[1] - old_line[1][1]))/old_line_length

        return movement