Here you can find the source of maxDifffer(double[][] pos)
Parameter | Description |
---|
public static double[] maxDifffer(double[][] pos)
//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; } }