class Vertex implements VertexInterface

Properties

protected CoordinatesInterface $from

The origin coordinate.

protected CoordinatesInterface $to

The destination coordinate.

protected float $gradient
protected float $ordinateIntercept
protected int $precision
static array $cardinalPoints

The cardinal points / directions (the four cardinal directions, the four ordinal directions, plus eight further divisions).

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.

int
getGradient()

Get the gradient (slope) of the vertex.

int
getOrdinateIntercept()

Get the ordinate (longitude) of the point where vertex intersects with the ordinate-axis (Prime-Meridian) of the coordinate system.

int
getPrecision()

No description

$this
setPrecision(int $precision)

No description

float
initialBearing()

Returns the initial bearing from the origin coordinate to the destination coordinate in degrees.

float
finalBearing()

Returns the final bearing from the origin coordinate to the destination coordinate in degrees.

string
initialCardinal()

Returns the initial cardinal point / direction from the origin coordinate to the destination coordinate.

string
finalCardinal()

Returns the final cardinal point / direction from the origin coordinate to the destination coordinate.

middle()

Returns the half-way point / coordinate along a great circle path between the origin and the destination coordinates.

destination(int $bearing, int $distance)

Returns the destination point with a given bearing in degrees travelling along a (shortest distance) great circle arc and a distance in meters.

bool
isOnSameLine(Vertex $vertex)

Returns true if the vertex passed on argument is on the same line as this object

getOtherCoordinate(CoordinatesInterface $coordinate)

Returns the other coordinate who is not the coordinate passed on argument

string
getDeterminant(Vertex $vertex)

Returns the determinant value between $this (vertex) and another vertex.

Details

at line 53
VertexInterface setFrom(CoordinatesInterface $from)

Set the origin coordinate.

Parameters

CoordinatesInterface $from

The origin coordinate.

Return Value

VertexInterface

at line 76
CoordinatesInterface getFrom()

Get the origin coordinate.

Return Value

CoordinatesInterface

at line 84
VertexInterface setTo(CoordinatesInterface $to)

Set the destination coordinate.

Parameters

CoordinatesInterface $to

The destination coordinate.

Return Value

VertexInterface

at line 107
CoordinatesInterface getTo()

Get the destination coordinate.

Return Value

CoordinatesInterface

at line 115
int getGradient()

Get the gradient (slope) of the vertex.

Return Value

int

at line 123
int getOrdinateIntercept()

Get the ordinate (longitude) of the point where vertex intersects with the ordinate-axis (Prime-Meridian) of the coordinate system.

Return Value

int

at line 131
int getPrecision()

No description

Return Value

int

at line 140
$this setPrecision(int $precision)

No description

Parameters

int $precision

Return Value

$this

at line 153
float initialBearing()

Returns the initial bearing from the origin coordinate to the destination coordinate in degrees.

Return Value

float

The initial bearing in degrees

at line 171
float finalBearing()

Returns the final bearing from the origin coordinate to the destination coordinate in degrees.

Return Value

float

The final bearing in degrees

at line 190
string initialCardinal()

Returns the initial cardinal point / direction from the origin coordinate to the destination coordinate.

Return Value

string

The initial cardinal point / direction

See also

http://en.wikipedia.org/wiki/Cardinal_direction

at line 202
string finalCardinal()

Returns the final cardinal point / direction from the origin coordinate to the destination coordinate.

Return Value

string

The final cardinal point / direction

See also

http://en.wikipedia.org/wiki/Cardinal_direction

at line 213
Coordinates middle()

Returns the half-way point / coordinate along a great circle path between the origin and the destination coordinates.

Return Value

Coordinates

at line 238
Coordinates destination(int $bearing, int $distance)

Returns the destination point with a given bearing in degrees travelling along a (shortest distance) great circle arc and a distance in meters.

Parameters

int $bearing

The bearing of the origin in degrees.

int $distance

The distance from the origin in meters.

Return Value

Coordinates

at line 259
bool isOnSameLine(Vertex $vertex)

Returns true if the vertex passed on argument is on the same line as this object

Parameters

Vertex $vertex

The vertex to compare

Return Value

bool

at line 280
null|CoordinatesInterface getOtherCoordinate(CoordinatesInterface $coordinate)

Returns the other coordinate who is not the coordinate passed on argument

Parameters

CoordinatesInterface $coordinate

Return Value

null|CoordinatesInterface

at line 297
string getDeterminant(Vertex $vertex)

Returns the determinant value between $this (vertex) and another vertex.

Parameters

Vertex $vertex

Return Value

string