Calculates path length
@param delta
@param controlPoints
@return
177767
public double pathLength(double delta, double... controlPoints)
    {
        if (delta < 0 || delta > 0.5)
        {
            throw new IllegalArgumentException("illegal delta");
        }
        Point2D.Double p1 = new Point2D.Double();
        Point2D.Double p2 = new Point2D.Double();
        double sum = 0;
        calc(0, p1::setLocation, controlPoints);
        for (double t=delta;t<1.0;t+=delta)
        {
            calc(t, p2::setLocation, controlPoints);
            sum += p1.distance(p2);
            p1.setLocation(p2);
        }
        calc(1.0, p2::setLocation, controlPoints);
        sum += p1.distance(p2);
        return sum;
    }
461535
public double getLength() {
		double len = 0;
		if (!isEmpty()) {
			for (int i = 0; i < coordinates.length - 1; i++) {
				double deltaX = coordinates[i + 1].getX() - coordinates[i].getX();
				double deltaY = coordinates[i + 1].getY() - coordinates[i].getY();
				len += Math.sqrt(deltaX * deltaX + deltaY * deltaY);
			}
		}
		return len;
	}
966888
function getMarkLength(markType, nodes) {
  let length = 0;
  while (nodes[length] && nodes[length].marks.includes(markType)) {
    ++length;
  }
  return { markType, length };
}
503950
public long getAndAdd(T obj, long delta) {
        long prev, next;
        do {
            prev = get(obj);
            next = prev + delta;
        } while (!compareAndSet(obj, prev, next));
        return prev;
    }
501717
@Pure
	GP createPath(AStarNode<ST, PT> startPoint, PT endPoint, List<AStarNode<ST, PT>> closeList) {
		int idx;
		ST segment;
		PT point;
		AStarNode<ST, PT> node;
		GP path = null;
		final CloseComparator<ST, PT> cComparator = new CloseComparator<>();

		node = newAStarNode(endPoint, Double.NaN, Double.NaN, null);
		idx = ListUtil.indexOf(closeList, cComparator, node);

		if (idx >= 0) {
			node = closeList.remove(idx);
			point = node.getGraphPoint();
			segment = node.getArrivalConnection();
			if (point != null && segment != null) {
				final LinkedList<ST> pathSegments = new LinkedList<>();
				pathSegments.add(segment);
				do {
					point = segment.getOtherSidePoint(point);
					node = newAStarNode(point, Double.NaN, Double.NaN, null);
					idx = ListUtil.indexOf(closeList, cComparator, node);
					if (idx >= 0) {
						node = closeList.remove(idx);
						segment = node.getArrivalConnection();
						if (segment != null) {
							pathSegments.add(segment);
						}
					} else {
						point = null;
						segment = null;
					}
				}
				while (point != null && segment != null);

				// Building of the path is done is a second step
				// because the oriented graph cannot enable to
				// built it during the previous step loop:
				// isConnectedSegment replies false when tested
				// with an arrival segment and cannot
				// enable to go backward along the path.
				final Iterator<ST> iterator = pathSegments.descendingIterator();
				if (iterator.hasNext()) {
					segment = iterator.next();
					if (startPoint.getGraphPoint().isConnectedSegment(segment)) {
						path = newPath(startPoint.getGraphPoint(), segment);
						while (iterator.hasNext()) {
							addToPath(path, iterator.next());
						}
					}
				}
			}
		}

		return path;
	}
371622
public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) {
        //	get the great circle path length in meters
        final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint);

        //	add one point for every 100kms of the great circle path
        final int numberOfPoints = greatCircleLength/100000;

        addGreatCircle(startPoint, endPoint, numberOfPoints);
	}
203579
protected void createPath (List<Point> points)
    {
        Point last = null;
        int size = points.size();
        for (int ii = 0; ii < size; ii++) {
            Point p = points.get(ii);

            int dir = (ii == 0) ? NORTH : DirectionUtil.getDirection(last, p);
            addNode(p.x, p.y, dir);
            last = p;
        }
    }
168042
public ParameterizedOperator operator(Point2D.Double... controlPoints)
    {
        if (controlPoints.length != length)
        {
            throw new IllegalArgumentException("control-points length not "+length);
        }
        double[] cp = convert(controlPoints);
        return operator(cp);
    }
980678
def terminal_path_lengths_per_neurite(neurites, neurite_type=NeuriteType.all):
    ''''''
    return list(sectionfunc.section_path_length(s)
                for n in iter_neurites(neurites, filt=is_type(neurite_type))
                for s in iter_sections(n, iterator_type=Tree.ileaf))
6967
@Pure
	public double distanceSquaredSegment(Point3D point) {
		return distanceSquaredSegmentPoint(
				getX1(), getY1(), getZ1(),
				getX2(), getY2(), getZ2(),
				point.getX(), point.getY(), point.getZ());
	}
840125
public void setControlPoints(List<Vertex> controlPoints)
	{
		this.controlPoints = controlPoints != null ? controlPoints : new ArrayList<>();
		dirty = true;
	}
796888
function _createPathData(d) {
  var sX = d.source.y,
      sY = d.source.x,
      tX = d.target.y,
      tY = d.target.x,
      mX = (sX + tX)/2,
      mY = (sY + tY)/2,

      sH = Math.abs(sX - tX) * 0.35,
      sV = 0; // strength

  if(d.isBackwardLink) {
    if(sY === tY) {
      sV = 45;
      mY -= 50;
      if(sX === tX) {
        sX += _layout.linkDelta;
        tX -= _layout.linkDelta;
      }
    }
    sH = Math.abs(sX - tX) * 1.1;
  }

  return _layout.pathFormatter(
    sX, sY,

    sX + sH, sY - sV,
    mX, mY,

    tX - sH, tY - sV,
    tX, tY
  );
}
810163
public static int delta(int[] data, int start, int length, int init) {
                final int nextinit = data[start + length - 1];
                for (int i = length - 1; i > 0; --i) {
                        data[start + i] -= data[start + i - 1];
                }
                data[start] -= init;
                return nextinit;
        }
109137
def scourUnitlessLength(length, renderer_workaround=False, is_control_point=False):  # length is of a numeric type
    
    if not isinstance(length, Decimal):
        length = getcontext().create_decimal(str(length))
    initial_length = length

    # reduce numeric precision
    # plus() corresponds to the unary prefix plus operator and applies context precision and rounding
    if is_control_point:
        length = scouringContextC.plus(length)
    else:
        length = scouringContext.plus(length)

    # remove trailing zeroes as we do not care for significance
    intLength = length.to_integral_value()
    if length == intLength:
        length = Decimal(intLength)
    else:
        length = length.normalize()

    # Gather the non-scientific notation version of the coordinate.
    # Re-quantize from the initial value to prevent unnecessary loss of precision
    # (e.g. 123.4 should become 123, not 120 or even 100)
    nonsci = '{0:f}'.format(length)
    nonsci = '{0:f}'.format(initial_length.quantize(Decimal(nonsci)))
    if not renderer_workaround:
        if len(nonsci) > 2 and nonsci[:2] == '0.':
            nonsci = nonsci[1:]  # remove the 0, leave the dot
        elif len(nonsci) > 3 and nonsci[:3] == '-0.':
            nonsci = '-' + nonsci[2:]  # remove the 0, leave the minus and dot
    return_value = nonsci

    # Gather the scientific notation version of the coordinate which
    # can only be shorter if the length of the number is at least 4 characters (e.g. 1000 = 1e3).
    if len(nonsci) > 3:
        # We have to implement this ourselves since both 'normalize()' and 'to_sci_string()'
        # don't handle negative exponents in a reasonable way (e.g. 0.000001 remains unchanged)
        exponent = length.adjusted()  # how far do we have to shift the dot?
        length = length.scaleb(-exponent).normalize()  # shift the dot and remove potential trailing zeroes

        sci = six.text_type(length) + 'e' + six.text_type(exponent)

        if len(sci) < len(nonsci):
            return_value = sci

    return return_value
67495
public int getTotalRigidPoints() {
		if( rigids == null )
			return 0;

		int total = 0;
		for (int i = 0; i < rigids.length; i++) {
			total += rigids[i].points.length;
		}
		return total;
	}
578263
public static double calcLoad(Long deltaCpuTime, long deltaUptime, long factor) {
		if (deltaCpuTime == null || deltaCpuTime <= 0 || deltaUptime == 0) {
			return 0.0;
		}
		return deltaCpuTime * 100d / factor / deltaUptime;
	}
626900
private int computeFirstCompletelyVisibleItemPositionForScrolledX(float[] starts) {
        if (lSCell == null || starts == null || starts.length <= 0) {
            return 0;
        }
        for (int i = 0; i < starts.length; i++) {
            if (starts[i] >= lSCell.currentDistance) {
                return i;
            }
        }
        return starts.length - 1;
    }