public static EdgeAttribute weightedPairAverage(EdgeAttribute start, EdgeAttribute target, double position) {
        if (start == null && target == null) {
            System.out.println("Calculating point between two null edge attributes; returning null");
            return null;
        }

        if (start == null) {
            start = EdgeAttribute.zeroAttribute(target.size());
        }

        if (target == null) {
            target = EdgeAttribute.zeroAttribute(start.size());
        }

        if (start.vect.length != target.vect.length) {
            System.err.println("Error calculating point between edge attributes.  Edge attributes are different lenghts: " + start + " and " + target);
            throw new RuntimeException();
        }

        if (position < 0 || position > 1) {
            System.err.println("Error calculating point between edge attributes:  position " + position + " must be between 0 and 1");
        }

        if (start.equals(target)) {
            return start;
        }

        EdgeAttribute point = new EdgeAttribute(new double[start.vect.length]);

        for (int i = 0; i < start.vect.length; i++) {
            point.vect[i] = (1 - position) * start.vect[i] + position * target.vect[i];
        }
        return point;
    }