$node1 Array with 'x' and 'y' coordinate * @param array $node2 Array with 'x' and 'y' coordinate * @param int $heuristic Heuristic to use for calculation * * @return float * * @since 1.0.0 */ public static function metric(array $node1, array $node2, int $heuristic) : float { if ($heuristic === HeuristicType::MANHATTAN) { return Metrics2D::manhattan($node1, $node2); } elseif ($heuristic === HeuristicType::EUCLIDEAN) { return Metrics2D::euclidean($node1, $node2); } elseif ($heuristic === HeuristicType::OCTILE) { return Metrics2D::octile($node1, $node2); } elseif ($heuristic === HeuristicType::MINKOWSKI) { return Metrics2D::minkowski($node1, $node2, 1); } elseif ($heuristic === HeuristicType::CANBERRA) { return Metrics2D::canberra($node1, $node2); } elseif ($heuristic === HeuristicType::BRAY_CURTIS) { return Metrics2D::brayCurtis($node1, $node2); } return Metrics2D::chebyshev($node1, $node2); } }