Java Matrix Max Value maxDifffer(double[][] pos)

Here you can find the source of maxDifffer(double[][] pos)

Description

Returns max diff.

License

Open Source License

Parameter

Parameter Description

Return

vector of max differences in coordinates {xi,yi,zi}

Declaration

public static double[] maxDifffer(double[][] pos) 

Method Source Code

//package com.java2s;

public class Main {
    /** Returns max diff.
     * @param 4x3 array/*from ww  w . ja va2  s.  c o m*/
     * @return vector of max differences in coordinates {xi,yi,zi}
     */
    public static double[] maxDifffer(double[][] pos) {
        double[] min = new double[3]; // min position (minx, miny, minz)
        double[] max = new double[3]; // max position (maxx, maxy, maxz)
        int i, j;

        for (j = 0; j < 3; j++) {
            min[j] = pos[0][j]; // take position of 1-static sat as minimum.
            max[j] = pos[0][j]; // take position of 1-static sat as max.
            for (i = 1; i < 4; i++) {
                max[j] = Math.max(pos[i][j], max[j]);
                min[j] = Math.min(pos[i][j], min[j]);
            }
        }
        // d holds maxx - minx, maxy-miny, maxz-minz in (km)
        double[] d = new double[3];
        for (j = 0; j < 3; j++)
            d[j] = max[j] - min[j];
        return d;
    }
}

Related

  1. max(double[][] x)
  2. max(float a[][][])
  3. max(float[][] a)
  4. max(float[][] originalValues, float[][] newValues, int[] indexArray, float value)
  5. max_abs(double[][] matrix)
  6. maxDistance(double[][] _values)
  7. maxIndices(double M[][])
  8. maxInRowIndex(double[][] M, int row)
  9. maxtrixPermutation(int beforeArray[][])