Create an ellipsoid from an array.

@param array $newEllipsoid The ellipsoid's parameters to create.

@return Ellipsoid
433541
public static function createFromArray(array $newEllipsoid)
    {
        if (!isset($newEllipsoid['name']) || !isset($newEllipsoid['a']) || !isset($newEllipsoid['invF'])
            || 3 !== count($newEllipsoid)) {
            throw new InvalidArgumentException('Ellipsoid arrays should contain `name`, `a` and `invF` keys !');
        }

        return new self($newEllipsoid['name'], $newEllipsoid['a'], $newEllipsoid['invF']);
    }
409689
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "ellipsoidRef")
    public JAXBElement<EllipsoidRefType> createEllipsoidRef(EllipsoidRefType value) {
        return new JAXBElement<EllipsoidRefType>(_EllipsoidRef_QNAME, EllipsoidRefType.class, null, value);
    }
428692
def _project_on_ellipsoid(c, r, locations):
    """"""
    p0 = locations - c  # original locations

    l2 = 1 / np.sum(p0**2 / r**2, axis=1, keepdims=True)
    p = p0 * np.sqrt(l2)  # initial approximation (projection of points towards center of ellipsoid)

    fun = lambda x: np.sum((x.reshape(p0.shape) - p0)**2)              # minimize distance between new and old points
    con = lambda x: np.sum(x.reshape(p0.shape)**2 / r**2, axis=1) - 1  # new points constrained to surface of ellipsoid
    res = sp.optimize.minimize(fun, p, constraints={'type': 'eq', 'fun': con}, method='SLSQP')

    return res['x'].reshape(p0.shape) + c
632747
@SuppressWarnings({"static-method", "checkstyle:magicnumber"})
	protected GISPolylineSet<RoadPolyline> createInternalDataStructure(Rectangle2afp<?, ?, ?, ?, ?, ?> originalBounds) {
		/*return new MapPolylineGridSet<>(100, 100,
				originalBounds.getMinX(),
				originalBounds.getMinY(),
				originalBounds.getWidth(),
				originalBounds.getHeight());*/
		return new MapPolylineTreeSet<>(
				originalBounds.getMinX(),
				originalBounds.getMinY(),
				originalBounds.getWidth(),
				originalBounds.getHeight());
	}
1057378
public static function create(object $googleData) : Coordinates
    {
        $build = new self($googleData);
        $address = $build->createCoordinatesFromGeometry();

        return $address;
    }
1333597
public function getFolderCreateForm($parentId = 0)
    {
        /** @var FolderCreateFormFactory $factory */
        $factory = Injector::inst()->get(FolderCreateFormFactory::class);
        $form = $factory->getForm($this, 'folderCreateForm', [ 'ParentID' => $parentId ]);

        // Set form action handler with ParentID included
        $form->setRequestHandler(
            LeftAndMainFormRequestHandler::create($form, [ $parentId ])
        );

        return $form;
    }
665894
public static Polygon create(org.locationtech.jts.geom.Polygon polygon) {
        double[] lats = new double[polygon.getNumPoints()];
        double[] lons = new double[polygon.getNumPoints()];
        for (int i = 0; i < polygon.getNumPoints(); i++) {
            lats[i] = polygon.getCoordinates()[i].y;
            lons[i] = polygon.getCoordinates()[i].x;
        }
        return new Polygon(lats, lons);
    }
664965
public function create(array $aData = [], $bReturnObject = false)
    {
        $mResult = parent::create($aData, $bReturnObject);
        if ($mResult) {
            $this->saveBreadcrumbs($bReturnObject ? $mResult->id : $mResult);
            $this->saveOrder();
            //  Refresh object to get updated breadcrumbs/URL
            if ($bReturnObject) {
                $mResult = $this->getById($mResult->id);
            }
        }
        return $mResult;
    }
1212136
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "usesEllipsoid")
    public JAXBElement<EllipsoidRefType> createUsesEllipsoid(EllipsoidRefType value) {
        return new JAXBElement<EllipsoidRefType>(_UsesEllipsoid_QNAME, EllipsoidRefType.class, null, value);
    }
882751
public function getMerge($array = [], $pid = 0, $level = 1, $maxLevel = 3){
        $list = [];

        if ($level <= $maxLevel){

            foreach ($array as $v) {
                if ($v[$this->_config['parent']] == $pid) {
                    $v['level'] = $level;
                    $v[$this->_config['child']] = $this->getMerge($array, $v['id'], $level + 1, $maxLevel);
                    $list[]     = $v;
                }
            }
        }

        return $list;
    }
1074736
public static ELResolver makeResolverForJSP()
    {
        Map<String, ImplicitObject> forJSPList = new HashMap<String, ImplicitObject>(8);//4
        ImplicitObject io1 = new FacesContextImplicitObject();
        forJSPList.put(io1.getName(), io1);
        ImplicitObject io2 = new ViewImplicitObject();
        forJSPList.put(io2.getName(), io2);
        ImplicitObject io3 = new ResourceImplicitObject();
        forJSPList.put(io3.getName(), io3);
        ImplicitObject io4 = new ViewScopeImplicitObject();
        forJSPList.put(io4.getName(), io4);
        return new ImplicitObjectResolver(forJSPList);
    }
1049425
public function createReserved($regionSlug)
    {
        $ip = $this->adapter->post(sprintf('%s/floating_ips', $this->endpoint), ['region' => $regionSlug]);

        $ip = json_decode($ip);

        return new FloatingIpEntity($ip->floating_ip);
    }
269610
public function createSentinel()
    {
        $persistence = $this->createPersistence();
        $users       = $this->createUsers();
        $roles       = $this->createRoles();
        $activations = $this->createActivations();
        $dispatcher  = $this->getEventDispatcher();

        $sentinel = new Sentinel(
            $persistence,
            $users,
            $roles,
            $activations,
            $dispatcher
        );

        $throttle = $this->createThrottling();

        $ipAddress = $this->getIpAddress();

        $checkpoints = $this->createCheckpoints($activations, $throttle, $ipAddress);

        foreach ($checkpoints as $key => $checkpoint) {
            $sentinel->addCheckpoint($key, $checkpoint);
        }

        $reminders = $this->createReminders($users);

        $sentinel->setActivationRepository($activations);

        $sentinel->setReminderRepository($reminders);

        $sentinel->setThrottleRepository($throttle);

        return $sentinel;
    }
965489
public static function create($parsed)
    {
        $result = new self();
        $hostedServices = Utilities::tryGetArray(
            Resources::XTAG_HOSTED_SERVICES,
            $parsed
        );
        $storageServices = Utilities::tryGetArray(
            Resources::XTAG_STORAGE_SERVICES,
            $parsed
        );

        $result->_affinityGroup = new AffinityGroup($parsed);

        foreach ($hostedServices as $value) {
            $service = new HostedService($value);
            $result->_hostedServices[] = $service;
        }

        foreach ($storageServices as $value) {
            $service = new StorageService($value);
            $result->_storageServices[] = $service;
        }

        return $result;
    }
698665
def from_shapely(sgeom, srid=None):
        
        if SHAPELY:
            WKBWriter.defaults["include_srid"] = True
            if srid:
                lgeos.GEOSSetSRID(sgeom._geom, srid)
            return Geometry(sgeom.wkb_hex)
        else:
            raise DependencyError("Shapely")
574742
public static function fromArray(array $points)
    {
        $parsed_points = array_map(function($p){
            if( !is_array($p) or sizeof($p) != 2)
                throw new GeoSpatialException('Error: array of array containing lat, lon expected.');
            return new Point($p[0], $p[1]);
        }, $points);
        return new static($parsed_points);
    }
33049
public function pidToId(string $pid) {
		return $this->entityModel->getIdDef()->getEntityProperty()->repToValue(urldecode($pid));
	}