midpoint: Midpoint between two points

Description Usage Arguments References Examples

Description

Calculate the half-way point along a great circle path between the two points. The point can be calculated along a great-circle or a rhumb line.

Usage

1
2
3
4
5
6
7
8
9
  midpoint(...)

  ## Default S3 method:
 midpoint(latitude1, longitude1,
    latitude2, longitude2, line = "greatcircle", ...)

  ## S3 method for class 'Coordinate'
 midpoint(coordinate1, coordinate2,
    line = "greatcircle", ...)

Arguments

latitude1

the first latitude coordinate

longitude1

the first longitude coordinate

latitude2

the second latitude coordinate

longitude2

the second longitude coordinate

coordinate1

the first coordinate class variable

coordinate2

the second coordinate class variable

line

a string with the line used to calculate greatcircle or rhumb

...

other arguments

References

http://www.movable-type.co.uk/scripts/latlong.html

Examples

1
2
3
4
5
6
7
8
cord1 <- Coordinate(43, -8)
cord2 <- Coordinate(42, -7)

# Using great-circle
mcord <- midpoint(cord1, cord2)

# Using rhumb
mcord <- midpoint(cord1, cord2, line = 'rhumb')

drodriguezperez/whereiam documentation built on May 15, 2019, 2:42 p.m.