distance
Description
returns the total distance traveled, in meters, for data stored in the GPS data object
traveledDistance
= distance(gpsData
)gpsData
.
Note
This function requires the Scenario Builder for Automated Driving Toolbox™ support package. You can install the Scenario Builder for Automated Driving Toolbox support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
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