Escolar Documentos
Profissional Documentos
Cultura Documentos
Em JAVA
private static List<Double> x = new ArrayList<Double>();
private static List<Double> y = new ArrayList<Double>();
private static List<Double> z = new ArrayList<Double>();
x.add(Double.parseDouble(latitute));
y.add(Double.parseDouble(longitude));
z.add(Double.parseDouble(altitude));
distTotal1 = 0;
for (int i = 1; i < x2e.size(); i++) {
double dx = (x1[i] - x1[i-1]);
double dy = (y1[i] - y1[i-1]);
double dz = (z1[i] - z1[i-1]);
distTotal1 += Math.sqrt(dx*dx + dy*dy + dz*dz);
}