You are here

function gmap_polyutil_dist in GMap Module 7.2

Same name and namespace in other branches
  1. 5 gmap_polyutil.inc \gmap_polyutil_dist()
  2. 6.2 gmap_polyutil.inc \gmap_polyutil_dist()
  3. 6 gmap_polyutil.inc \gmap_polyutil_dist()
  4. 7 gmap_polyutil.inc \gmap_polyutil_dist()

Distance in two dimensions.

√((x1-x0)^2 + (y1-y0)^2)

Deprecated

use GmapPolylineToolbox::getInstance()->setLinePoints($p1, $p2)->getDist();

File

./gmap_polyutil.inc, line 76
Encoded polyline utilities.

Code

function gmap_polyutil_dist($p1, $p2) {
  include_once drupal_get_path('module', 'gmap') . '/lib/Drupal/gmap/GmapPolylineToolbox.php';
  return GmapPolylineToolbox::getInstance()
    ->setLinePoints($p1, $p2)
    ->getDist();
}