//两点间距离
double dis = Math.pow(MathUtil.getDistanceSquare(list.get(i + 1).x, list.get(i + 1).y, list.get(i).x, list.get(i).y), 0.5);
// 计算斜率
double kx = (list.get(i + 1).x - list.get(i).x) / dis;
double kz = (list.get(i + 1).y - list.get(i).y) / dis;
//c为在两点间移动的距离
c = 2;
// 计算现在应该到达的距离
float x = (float) (list.get(i).x + (dis - (sumD - c)) * kx);
float z = (float) (list.get(i).y + (dis - (sumD - c)) * kz);
p.setX(x);
p.setY(nowPosition.getY());
p.setZ(z);
road.setIndex(i);
return p;
这个博客主要是javaEE相关或者不相关的记录,
hadoop与spark的相关文章我写在下面地址的博客啦~
http://www.cnblogs.com/sorco