Skip to contents

Given a current location (latitude and longitude), speed, direction (in radians), and time elapsed (in seconds), this function calculates the next latitude and longitude. The calculations are based on the assumption of a constant speed and direction during the elapsed time.

Usage

next_lat_long(latitude, longitude, speed, direction, dt)

Arguments

latitude

The current latitude in decimal degrees.

longitude

The current longitude in decimal degrees.

speed

The speed in kilometers per hour.

direction

The direction of movement in radians from due north (0 radians).

dt

The elapsed time in seconds.

Value

A numeric vector of length 2 containing the next latitude and longitude in decimal degrees.