PHP Class Treffynnon\Navigator\Distance

Mostrar archivo Open project: treffynnon/navigator Class Usage Examples

Protected Properties

Property Type Description
$point1 N\LatLong The first coordinate
$point2 N\LatLong The second coordinate

Public Methods

Method Description
__construct ( Treffynnon\Navigator\LatLong $point1, Treffynnon\Navigator\LatLong $point2 ) Instantiate the distance object and supply the two coordinates to calculate the distance between them
get ( Treffynnon\Navigator\Distance\Calculator\CalculatorInterface $calculator = null, Treffynnon\Navigator\Distance\Converter\ConverterInterface $unit_converter = null ) : float Calculate the distance between two points. Defaults to Vincenty if no calculator is supplied. If no unit converter is supplied then the formula will return a value in metres.

Method Details

__construct() public method

Instantiate the distance object and supply the two coordinates to calculate the distance between them
public __construct ( Treffynnon\Navigator\LatLong $point1, Treffynnon\Navigator\LatLong $point2 )
$point1 Treffynnon\Navigator\LatLong
$point2 Treffynnon\Navigator\LatLong

get() public method

Calculate the distance between two points. Defaults to Vincenty if no calculator is supplied. If no unit converter is supplied then the formula will return a value in metres.
public get ( Treffynnon\Navigator\Distance\Calculator\CalculatorInterface $calculator = null, Treffynnon\Navigator\Distance\Converter\ConverterInterface $unit_converter = null ) : float
$calculator Treffynnon\Navigator\Distance\Calculator\CalculatorInterface
$unit_converter Treffynnon\Navigator\Distance\Converter\ConverterInterface
return float

Property Details

$point1 protected_oe property

The first coordinate
protected N\LatLong $point1
return N\LatLong

$point2 protected_oe property

The second coordinate
protected N\LatLong $point2
return N\LatLong