nd4j-common/src/main/java/org/nd4j/linalg/util/MathUtils.java
public static List<Double> mergeCoords(List<Double> x, List<Double> y) {
        if (x.size() != y.size())
            throw new IllegalArgumentException(
                            "Sample sizes must be the same for each data applyTransformToDestination.");

        List<Double> ret = new ArrayList<Double>();

        for (int i = 0; i < x.size(); i++) {
            ret.add(x.get(i));
            ret.add(y.get(i));
        }
        return ret;
    }
public static List<Double> mergeCoords(List<Double> x, List<Double> y) {
        if (x.size() != y.size())
            throw new IllegalArgumentException(
                            "Sample sizes must be the same for each data applyTransformToDestination.");

        List<Double> ret = new ArrayList<Double>();

        for (int i = 0; i < x.size(); i++) {
            ret.add(x.get(i));
            ret.add(y.get(i));
        }
        return ret;
    }
This will merge the coordinates of the given coordinate system.

@param x the x coordinates
@param y the y coordinates
@return a vector such that each (x,y) pair is at ret[i],ret[i+1]