distance
Description
Add-On Required: This feature requires the Scenario Builder for Automated Driving Toolbox add-on.
returns the total distance traveled, in meters, for data stored in the GPS data object
traveledDistance = distance(gpsData)gpsData.
Examples
Input Arguments
Output Arguments
Algorithms
The function uses the Haversine formula to compute the distance between two world points specified as (lat1, lon1) and (lat2, lon2). The Haversine distance is calculated as:
distance = R*2*atan2(sqrt(A),sqrt(1-A)),
where, the value of R is 6,378,137 meters, which specifies the radius of the Earth, and A is computed as:
Version History
Introduced in R2024b
See Also
GPSData | Trajectory | CameraData | LidarData | recordedSensorData
