def node_location(span1_begin, span1_end, span2_begin, span2_end, num_nodes):
    """Calculate the coordinate location of the analysis nodes.

    Args:
        span1_begin (float): coordinate location of beginning of span 1
        span1_end (float): coordinate location of end of span 1
        span2_begin (float): coordinate location of beginning of span 2
        span2_end (float): coordinate location of end of span 2
        num_nodes (int): number of analysis nodes input by the user

    Returns:
        node_loc (list of floats): list of the coordinate locations of the
                                    analysis nodes along the beam

    Notes:
        The node values are rounded to three (3) decimal places. Otherwise the
        computer rounding messes up the functionality of later functions. For
        example if a node location is supposed to be directly over a pier
        support but it is 0.000000001 off the program will run as if that load
        is acting on span 1 and span 2 won't have that load applied even though
        it should be. 
    """
    span_length1 = span1_end - span1_begin
    span_length2 = span2_end - span2_begin

    if span_length1 < 0.0:
        raise ValueError("Must enter a positive float for span 1 length.")
    elif span_length2 < 0.0:
        raise ValueError("Must enter a positive float for span 2 length (or"
                "nothing for a default value of 0.0).")
    elif num_nodes <= 0:
        raise ValueError("Must enter a postive interger for number of nodes"
                            "(the recommended minimum number of nodes is 21.).")
    else:
        node_loc = []
        
        #span length 1 node locations
        x1 = 0.0
        dx1 = span_length1/(num_nodes - 1)

        for i in range(num_nodes):
            if i == 0:
                node_loc.append(x1)
            elif i == (num_nodes - 1):
                node_loc.append(span1_end)
            else:
                x1 = round(x1 + dx1,3)
                node_loc.append(x1)

        #span length 2 node locations
        if span_length2 > 0:

            x2 = span_length1
            dx2 = span_length2/(num_nodes - 1)
            
            for i in range(num_nodes):
                if i == 0:
                    pass #second span beginning is end of first span
                elif i == (num_nodes - 1):
                    node_loc.append(span2_end)
                else:
                    x2 = round(x2 + dx2,3)
                    node_loc.append(x2)

    return node_loc