Location\Coordinate::__construct PHP Method

__construct() public method

public __construct ( float $lat, float $lng, Ellipsoid $ellipsoid = null )
$lat float -90.0 .. +90.0
$lng float -180.0 .. +180.0
$ellipsoid Ellipsoid if omitted, WGS-84 is used
    public function __construct($lat, $lng, Ellipsoid $ellipsoid = null)
    {
        if (!$this->isValidLatitude($lat)) {
            throw new \InvalidArgumentException("Latitude value must be numeric -90.0 .. +90.0 (given: {$lat})");
        }
        if (!$this->isValidLongitude($lng)) {
            throw new \InvalidArgumentException("Longitude value must be numeric -180.0 .. +180.0 (given: {$lng})");
        }
        $this->lat = doubleval($lat);
        $this->lng = doubleval($lng);
        if ($ellipsoid !== null) {
            $this->ellipsoid = $ellipsoid;
            return;
        }
        $this->ellipsoid = Ellipsoid::createDefault();
    }