bearing: Initial bearing between two points

Description Usage Arguments References Examples

Description

Calculate the initial bearing between two points. This bearing which if followed in a straight line along a great-circle arc will take you from the start point to the end point. The point can be calculated along a great-circle or a rhumb line.

Usage

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

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

  ## S3 method for class 'Coordinate'
 bearing(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
brg   <- bearing(cord1, cord2)

# Using rhumb
brg   <- bearing(cord1, cord2, line = 'rhumb')

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