Skip to contents

This function calculates the geographic coordinates (latitude and longitude) for a given distance and bearing from a specified origin.

Usage

seasonder_computeLonLatFromOriginDistBearing(
  origin_lon,
  origin_lat,
  dist,
  bearing
)

Arguments

origin_lon

A numeric value representing the longitude of the origin point in decimal degrees.

origin_lat

A numeric value representing the latitude of the origin point in decimal degrees.

dist

A numeric value representing the distance from the origin in kilometers.

bearing

A numeric vector of bearings (in degrees) indicating the direction from the origin.

Value

A data frame with two columns:

  • lon: The longitude of the computed geographic coordinates.

  • lat: The latitude of the computed geographic coordinates.

Details

The function uses the geodetic formulas provided by the geosphere package to compute the destination point based on:

  • Origin longitude and latitude

  • Distance in meters (converted from kilometers)

  • Bearing in degrees

The calculation employs the geosphere::destPoint function, which handles the spherical geometry of the Earth.

See also

Examples

# Example with a point at 100 km to the north of the origin
result <- seasonder_computeLonLatFromOriginDistBearing(-123.3656, 48.4284, 100, 0)
print(result)
#>         lon      lat
#> 1 -123.3656 49.32762