View source: R/SeaSondeRCS_MUSIC.R
seasonder_computeLonLatFromOriginDistBearing | R Documentation |
This function calculates the geographic coordinates (latitude and longitude) for a given distance and bearing from a specified origin.
seasonder_computeLonLatFromOriginDistBearing(
origin_lon,
origin_lat,
dist,
bearing
)
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. |
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.
A data frame with two columns:
lon
: The longitude of the computed geographic coordinates.
lat
: The latitude of the computed geographic coordinates.
destPoint
# Example with a point at 100 km to the north of the origin
result <- seasonder_computeLonLatFromOriginDistBearing(-123.3656, 48.4284, 100, 0)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.