Пример #1
0
 /**
  * @param before
  * @param now
  * @param after
  * @param fastLength
  */
 public segmentSpeeds(Rr2Point before, Rr2Point now, Rr2Point after, double fastLength) {
   Rr2Point a = Rr2Point.sub(now, before);
   double amod = a.mod();
   abandon = amod == 0;
   if (abandon) return;
   Rr2Point b = Rr2Point.sub(after, now);
   if (b.mod() == 0) ca = 0;
   else ca = Rr2Point.mul(a.norm(), b.norm());
   plotMiddle = true;
   if (amod <= 2 * fastLength) {
     fastLength = amod * 0.5;
     plotMiddle = false;
   }
   a = a.norm();
   p1 = Rr2Point.add(before, Rr2Point.mul(a, fastLength));
   p2 = Rr2Point.add(p1, Rr2Point.mul(a, amod - 2 * fastLength));
   p3 = Rr2Point.add(p2, Rr2Point.mul(a, fastLength));
 }