标签:tin 应该 list class log position float math dex
//两点间距离 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;
标签:tin 应该 list class log position float math dex
原文地址:http://www.cnblogs.com/orco/p/6150487.html