lib/geodesic.js
function geodesic_distance(cells, positions, p, max_distance, tolerance, stars) {

  if(typeof(max_distance) === "undefined") {
    max_distance = Number.POSITIVE_INFINITY
  }
  if(typeof(tolerance) === "undefined") {
    tolerance = 1e-4
  }
  if(typeof(dual) === "undefined") {
    stars = top.dual(cells, positions.length)
  }

  //First, run Dijkstra's algorithm to get an initial bound on the distance from each vertex
  // to the base point just using edge lengths
  var distances = dijkstra(p, stars, cells, positions, max_distance);
  
  //Then refine distances to acceptable threshold
  refine_distances(p, distances, positions, stars, cells, max_distance, tolerance);
  
  return distances;
}
function geodesic_distance(cells, positions, p, max_distance, tolerance, stars) {

  if(typeof(max_distance) === "undefined") {
    max_distance = Number.POSITIVE_INFINITY
  }
  if(typeof(tolerance) === "undefined") {
    tolerance = 1e-4
  }
  if(typeof(dual) === "undefined") {
    stars = top.dual(cells, positions.length)
  }

  //First, run Dijkstra's algorithm to get an initial bound on the distance from each vertex
  // to the base point just using edge lengths
  var distances = dijkstra(p, stars, cells, positions, max_distance);
  
  //Then refine distances to acceptable threshold
  refine_distances(p, distances, positions, stars, cells, max_distance, tolerance);
  
  return distances;
}
function geodesic_distance ( cells , positions , p , max_distance , tolerance , stars ) { if ( typeof ( max_distance ) === "undefined" ) { max_distance = Number . POSITIVE_INFINITY } if ( typeof ( tolerance ) === "undefined" ) { tolerance = 1e-4 } if ( typeof ( dual ) === "undefined" ) { stars = top . dual ( cells , positions . length ) } //First, run Dijkstra's algorithm to get an initial bound on the distance from each vertex // to the base point just using edge lengths var distances = dijkstra ( p , stars , cells , positions , max_distance ) ; //Then refine distances to acceptable threshold refine_distances ( p , distances , positions , stars , cells , max_distance , tolerance ) ; return distances ; }
Computes a distances to a vertex p
Computes a distances to a vertex p