public function lenght($provider = "haversine")
    {
        $length = 0;
        for($i = 0; $i < count($this)-2 ; $i++ ){
            $length += Point::distance($this->points[$i], $this->points[$i+1], $provider);
        }
        return $length;

    }