interface DistanceInterface

Methods

setFrom(CoordinatesInterface $from)

Set the origin coordinate

getFrom()

Get the origin coordinate

setTo(CoordinatesInterface $to)

Set the destination coordinate

getTo()

Get the destination coordinate

in(string $unit)

Set the user unit

string
getUnit()

Get the user unit

withData(string $name, mixed $value)

No description

mixed
getData(string $name, mixed|null $default = null)

No description

haversine()

No description

Details

at line 14
DistanceInterface setFrom(CoordinatesInterface $from)

Set the origin coordinate

Parameters

CoordinatesInterface $from

The origin coordinate

Return Value

DistanceInterface

at line 21
CoordinatesInterface getFrom()

Get the origin coordinate

Return Value

CoordinatesInterface

at line 30
DistanceInterface setTo(CoordinatesInterface $to)

Set the destination coordinate

Parameters

CoordinatesInterface $to

The destination coordinate

Return Value

DistanceInterface

at line 37
CoordinatesInterface getTo()

Get the destination coordinate

Return Value

CoordinatesInterface

at line 46
DistanceInterface in(string $unit)

Set the user unit

Parameters

string $unit

Set the unit

Return Value

DistanceInterface

at line 53
string getUnit()

Get the user unit

Return Value

string

at line 61
DistanceInterface withData(string $name, mixed $value)

No description

Parameters

string $name
mixed $value

Return Value

DistanceInterface

at line 69
mixed getData(string $name, mixed|null $default = null)

No description

Parameters

string $name
mixed|null $default

Return Value

mixed

at line 71
haversine()

No description