way-search/different-directions

There is no license information available for the latest version (dev-master) of this package.

dev-master 2018-05-10 17:29 UTC

This package is not auto-updated.

Last update: 2024-12-13 22:32:01 UTC


README

composer require way-search/different-directions "dev-master"

Require

  • PHP 7.*+

Example use with test data

<?php

require_once __DIR__ . "/vendor/autoload.php";

$filePath = __DIR__ . "/vendor/way-search/different-directions/example/data/sample.in";

$parser = new \WaySearch\Service\DirectionFileParser($filePath);
$directions = $parser->getDirections();
$cases = new \WaySearch\Service\DirectionCases($directions);

foreach ($cases as $case) {
    $point = $case->getAvgEndPoint();
    $diff = $case->getDifference();
    echo "{$point->x} {$point->y} {$diff}" . PHP_EOL;
}