/** * * @param EGMapCoord $gmap_coord * @return boolean $is_inside * @author fabriceb * @since Jun 2, 2009 fabriceb */ public function containsEGMapCoord(EGMapCoord $gmap_coord) { $is_inside = $gmap_coord->getLatitude() < $this->getNorthEast()->getLatitude() && $gmap_coord->getLatitude() > $this->getSouthWest()->getLatitude() && $gmap_coord->getLongitude() < $this->getNorthEast()->getLongitude() && $gmap_coord->getLongitude() > $this->getSouthWest()->getLongitude(); return $is_inside; }
/** * * @param EGMapMarker[] $markers array of Markers * @return EGMapCoord * @author fabriceb * @since 2009-05-02 * @since 2011-01-25 modified by Antonio Ramirez * */ public static function getMassCenterCoord($markers) { $coords = array(); foreach ($markers as $marker) { array_push($coords, $marker->position); } return EGMapCoord::getMassCenterCoord($coords); }
/** * exact distance with Haversine formula * * @param EGMapCoord $coord1 * @param EGMapCoord $coord2 * @return float * @see exactDistanceFrom * * @author fabriceb * @since Apr 21, 2010 */ public static function exactDistance($coord1, $coord2) { return $coord1->exactDistanceFrom($coord2); }