/** * Calculate distance of current step from latitude/longitude * @return double */ public function calculatedStepDistance() { $LastGeohash = (new Geohash())->decode($this->Object->at($this->LastIndex, Entity::GEOHASHES))->getCoordinate(); $IndexGeohash = (new Geohash())->decode($this->Object->at($this->Index, Entity::GEOHASHES))->getCoordinate(); return Entity::gpsDistance($LastGeohash->getLatitude(), $LastGeohash->getLongitude(), $IndexGeohash->getLatitude(), $IndexGeohash->getLongitude()); }