Builds the path for an open arc based on a PolylineOptions.

@param center
@param start
@param end
@return PolylineOptions with the paths element populated.
548605
public static final PolylineOptions buildOpenArc(LatLong center, LatLong start, LatLong end) {
        MVCArray res = buildArcPoints(center, start, end);
        return new PolylineOptions().path(res);
    }
448670
private static Options constructCliOptions() {
    Options options = new Options();

    Option cluster = Option.builder("c")
        .desc("Cluster name in which the topology needs to run on")
        .longOpt(CliArgs.CLUSTER.text)
        .hasArgs()
        .argName(CliArgs.CLUSTER.text)
        .required()
        .build();

    Option role = Option.builder("r")
        .desc("Role under which the topology needs to run")
        .longOpt(CliArgs.ROLE.text)
        .hasArgs()
        .argName(CliArgs.ROLE.text)
        .required()
        .build();

    Option environment = Option.builder("e")
        .desc("Environment under which the topology needs to run")
        .longOpt(CliArgs.ENVIRONMENT.text)
        .hasArgs()
        .argName(CliArgs.ENVIRONMENT.text)
        .build();

    Option heronHome = Option.builder("d")
        .desc("Directory where heron is installed")
        .longOpt(CliArgs.HERON_HOME.text)
        .hasArgs()
        .argName("heron home dir")
        .build();

    Option configFile = Option.builder("p")
        .desc("Path of the config files")
        .longOpt(CliArgs.CONFIG_PATH.text)
        .hasArgs()
        .argName("config path")
        .build();

    Option topologyName = Option.builder("n")
        .desc("Name of the topology")
        .longOpt(CliArgs.TOPOLOGY_NAME.text)
        .hasArgs()
        .argName("topology name")
        .required()
        .build();

    Option metricsSourceURL = Option.builder("t")
        .desc("metrics data source url with port number")
        .longOpt(CliArgs.METRIC_SOURCE_URL.text)
        .hasArgs()
        .argName("data source url")
        .build();

    // candidate metrics sources are:
    // org.apache.heron.healthmgr.sensors.TrackerMetricsProvider (default)
    // org.apache.heron.healthmgr.sensors.MetricsCacheMetricsProvider
    Option metricsSourceType = Option.builder("s")
        .desc("metrics data source type")
        .longOpt(CliArgs.METRIC_SOURCE_TYPE.text)
        .hasArg()
        .argName("data source type")
        .build();

    // candidates:
    // local: Health manager is started manually
    // cluster: Health manager is started by executor on container 0 (default)
    Option mode = Option.builder("m")
        .desc("Health manager process mode, cluster or local")
        .longOpt(CliArgs.MODE.text)
        .hasArg()
        .argName("process mode")
        .build();

    Option metricsMgrPort = Option.builder("m")
        .desc("Port of local MetricsManager")
        .longOpt(CliArgs.METRICSMGR_PORT.text)
        .hasArgs()
        .argName("metrics_manager port")
        .required()
        .build();

    Option verbose = Option.builder("v")
        .desc("Enable debug logs")
        .longOpt(CliArgs.VERBOSE.text)
        .build();

    options.addOption(cluster);
    options.addOption(role);
    options.addOption(environment);
    options.addOption(heronHome);
    options.addOption(configFile);
    options.addOption(topologyName);
    options.addOption(metricsSourceType);
    options.addOption(metricsSourceURL);
    options.addOption(mode);
    options.addOption(metricsMgrPort);
    options.addOption(verbose);

    return options;
  }
258107
protected int selectSplitBetween(int indexStart, int indexEnd) {

		Point2D_I32 a = contour.get(indexStart);
		Point2D_I32 c = contour.get(indexEnd);

		line.p.set(a.x,a.y);
		line.slope.set(c.x-a.x,c.y-a.y);

		int bestIndex = -1;
		double bestDistanceSq = splitThresholdSq(contour.get(indexStart), contour.get(indexEnd));

		// adjusting using 'minimumSideLengthPixel' to ensure it doesn't create a new line which is too short
		int minLength = Math.max(1,minimumSideLengthPixel);// 1 is the minimum so that you don't split on the same corner
		int length = indexEnd-indexStart-minLength;

		// don't try splitting at the two end points
		for( int i = minLength; i <= length; i++ ) {
			int index = indexStart+i;
			Point2D_I32 b = contour.get(index);
			point2D.set(b.x,b.y);

			double dist = Distance2D_F64.distanceSq(line, point2D);
			if( dist >= bestDistanceSq ) {
				bestDistanceSq = dist;
				bestIndex = index;
			}
		}
		return bestIndex;
	}
476290
function createEndpointFromPath(path, query, filePath) {
  filePath = filePath || path;
  return createEndpointFromObject(path, query, getJSON(filePath));
}
1119357
@VisibleForTesting
    static String makeEndPointPath(ServiceEndPoint endPoint) {
        String servicePath = makeServicePath(endPoint.getServiceName());
        String id = endPoint.getId();
        return ZKPaths.makePath(servicePath, id);
    }
890951
public void setCenterProperties(Point3d center) {
		this.cxProperty = center.xProperty;
		this.cyProperty = center.yProperty;
		this.czProperty = center.zProperty;
	}
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;
        }
    }
1360260
public static KeyRange openClosed(Key start, Key end) {
    return new KeyRange(checkNotNull(start), Endpoint.OPEN, checkNotNull(end), Endpoint.CLOSED);
  }
678468
def _create_path(self, *args):
        """"""
        args = filter(None, args)
        path = self.endpoint + '/'.join(args)
        return path
1159123
public static Point3d centroid(Point3d[] x) {
		Point3d center = new Point3d();
		for (Point3d p : x) {
			center.add(p);
		}
		center.scale(1.0 / x.length);
		return center;
	}
500942
public Result<FindPolysAroundResult> findPolysAroundCircle(long startRef, float[] centerPos, float radius,
            QueryFilter filter) {

        // Validate input

        if (!m_nav.isValidPolyRef(startRef) || Objects.isNull(centerPos) || !vIsFinite(centerPos) || radius < 0
                || !Float.isFinite(radius) || Objects.isNull(filter)) {
            return Result.invalidParam();
        }

        List<Long> resultRef = new ArrayList<>();
        List<Long> resultParent = new ArrayList<>();
        List<Float> resultCost = new ArrayList<>();

        m_nodePool.clear();
        m_openList.clear();

        Node startNode = m_nodePool.getNode(startRef);
        vCopy(startNode.pos, centerPos);
        startNode.pidx = 0;
        startNode.cost = 0;
        startNode.total = 0;
        startNode.id = startRef;
        startNode.flags = Node.DT_NODE_OPEN;
        m_openList.push(startNode);

        float radiusSqr = sqr(radius);

        while (!m_openList.isEmpty()) {
            Node bestNode = m_openList.pop();
            bestNode.flags &= ~Node.DT_NODE_OPEN;
            bestNode.flags |= Node.DT_NODE_CLOSED;

            // Get poly and tile.
            // The API input has been cheked already, skip checking internal data.
            long bestRef = bestNode.id;
            Tupple2<MeshTile, Poly> tileAndPoly = m_nav.getTileAndPolyByRefUnsafe(bestRef);
            MeshTile bestTile = tileAndPoly.first;
            Poly bestPoly = tileAndPoly.second;

            // Get parent poly and tile.
            long parentRef = 0;
            MeshTile parentTile = null;
            Poly parentPoly = null;
            if (bestNode.pidx != 0) {
                parentRef = m_nodePool.getNodeAtIdx(bestNode.pidx).id;
            }
            if (parentRef != 0) {
                tileAndPoly = m_nav.getTileAndPolyByRefUnsafe(parentRef);
                parentTile = tileAndPoly.first;
                parentPoly = tileAndPoly.second;
            }

            resultRef.add(bestRef);
            resultParent.add(parentRef);
            resultCost.add(bestNode.total);

            for (int i = bestPoly.firstLink; i != NavMesh.DT_NULL_LINK; i = bestTile.links.get(i).next) {
                Link link = bestTile.links.get(i);
                long neighbourRef = link.ref;
                // Skip invalid neighbours and do not follow back to parent.
                if (neighbourRef == 0 || neighbourRef == parentRef) {
                    continue;
                }

                // Expand to neighbour
                tileAndPoly = m_nav.getTileAndPolyByRefUnsafe(neighbourRef);
                MeshTile neighbourTile = tileAndPoly.first;
                Poly neighbourPoly = tileAndPoly.second;

                // Do not advance if the polygon is excluded by the filter.
                if (!filter.passFilter(neighbourRef, neighbourTile, neighbourPoly)) {
                    continue;
                }

                // Find edge and calc distance to the edge.
                Result<PortalResult> pp = getPortalPoints(bestRef, bestPoly, bestTile, neighbourRef, neighbourPoly,
                        neighbourTile, 0, 0);
                if (pp.failed()) {
                    continue;
                }
                float[] va = pp.result.left;
                float[] vb = pp.result.right;

                // If the circle is not touching the next polygon, skip it.
                Tupple2<Float, Float> distseg = distancePtSegSqr2D(centerPos, va, vb);
                float distSqr = distseg.first;
                if (distSqr > radiusSqr) {
                    continue;
                }

                Node neighbourNode = m_nodePool.getNode(neighbourRef);

                if ((neighbourNode.flags & Node.DT_NODE_CLOSED) != 0) {
                    continue;
                }

                // Cost
                if (neighbourNode.flags == 0) {
                    neighbourNode.pos = vLerp(va, vb, 0.5f);
                }

                float cost = filter.getCost(bestNode.pos, neighbourNode.pos, parentRef, parentTile, parentPoly, bestRef,
                        bestTile, bestPoly, neighbourRef, neighbourTile, neighbourPoly);

                float total = bestNode.total + cost;
                // The node is already in open list and the new result is worse, skip.
                if ((neighbourNode.flags & Node.DT_NODE_OPEN) != 0 && total >= neighbourNode.total) {
                    continue;
                }

                neighbourNode.id = neighbourRef;
                neighbourNode.pidx = m_nodePool.getNodeIdx(bestNode);
                neighbourNode.total = total;

                if ((neighbourNode.flags & Node.DT_NODE_OPEN) != 0) {
                    m_openList.modify(neighbourNode);
                } else {
                    neighbourNode.flags = Node.DT_NODE_OPEN;
                    m_openList.push(neighbourNode);
                }
            }
        }

        return Result.success(new FindPolysAroundResult(resultRef, resultParent, resultCost));
    }
977071
public static INDArrayIndex[] createFromStartAndEnd(INDArray start, INDArray end) {
        if (start.length() != end.length())
            throw new IllegalArgumentException("Start length must be equal to end length");
        else {
            if (start.length() > Integer.MAX_VALUE)
                throw new ND4JIllegalStateException("Can't proceed with INDArray with length > Integer.MAX_VALUE");

            INDArrayIndex[] indexes = new INDArrayIndex[(int) start.length()];
            for (int i = 0; i < indexes.length; i++) {
                indexes[i] = NDArrayIndex.interval(start.getInt(i), end.getInt(i));
            }
            return indexes;
        }
    }
896296
private void createStar() {
        Point2D.Float point = start;
        p = new GeneralPath(GeneralPath.WIND_NON_ZERO);
        p.moveTo(point.x, point.y);
        p.lineTo(point.x + 3.0f, point.y - 1.5f);            // Line from start to A
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x + 1.5f, point.y - 3.0f);            // Line from A to B
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x + 1.5f, point.y + 3.0f);            // Line from B to C
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x + 3.0f, point.y + 1.5f);            // Line from C to D
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x - 3.0f, point.y + 1.5f);            // Line from D to E
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x - 1.5f, point.y + 3.0f);            // Line from E to F
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x - 1.5f, point.y - 3.0f);            // Line from F to g
        p.closePath();                                        // Line from G to start
    }
1134360
public static Point2D getPathIntersect(final WiresConnection connection, final MultiPath path, final Point2D c, final int pointIndex)
    {
        final Point2DArray plist = connection.getConnector().getLine().getPoint2DArray();

        Point2D p = plist.get(pointIndex).copy();

        final Point2D offsetP = path.getComputedLocation();

        p.offset(-offsetP.getX(), -offsetP.getY());

        // p may be within the path boundary, so work of a vector that guarantees a point outside
        final double width = path.getBoundingBox().getWidth();

        if (c.equals(p))
        {
            // this happens with the magnet is over the center of the opposite shape
            // so either the shapes are horizontall or vertically aligned.
            // this means we can just take the original centre point for the project
            // without this the project throw an error as you cannot unit() something of length 0,0
            p.offset(offsetP.getX(), offsetP.getY());
        }
        try
        {
            p = getProjection(c, p, width);

            final Set<Point2D>[] set = Geometry.getCardinalIntersects(path, new Point2DArray(c, p));

            final Point2DArray points = Geometry.removeInnerPoints(c, set);

            return (points.size() > 1) ? points.get(1) : null;
        }
        catch (final Exception e)
        {
            return null;
        }
    }
230124
function generateArcPath (x, y, radius, startAngle, endAngle) {
  var start = polarToCartesian(x, y, radius, startAngle);
  var end = polarToCartesian(x, y, radius, endAngle);
  var arcSweep = endAngle - startAngle <= 180 ? '0' : '1';
  return [
    'M', start.x, start.y,
    'A', radius, radius, 0, arcSweep, 0, end.x, end.y
  ].join(' ');
}
1246508
def centerOn(self, *args):
        
        super(XNodeWidget, self).centerOn(*args)
        
        for con in self.connections():
            con.setPath(con.rebuild())
            con.update()
825643
public static void center(Point3d[] x) {
		Point3d center = centroid(x);
		center.negate();
		translate(new Vector3d(center), x);
	}