calculate_average_speed
Calculate average speed from position and time data to analyze motion along a path, returning speed, distance, time, and displacement metrics.
Instructions
Calculate average speed along a path.
Average speed = total distance / total time
(Distance is path length, not displacement)
Args:
positions: Position vectors [[x,y,z], ...] in meters (or JSON string)
times: Time values in seconds (or JSON string)
Returns:
Dict containing:
- average_speed: Average speed in m/s
- total_distance: Total path length in meters
- total_time: Total elapsed time in seconds
- displacement_magnitude: Straight-line displacement in meters
- displacement: Displacement vector [x,y,z] in meters
Example - Car on winding road:
result = await calculate_average_speed(
positions=[[0,0,0], [10,5,0], [20,10,0], [15,20,0]],
times=[0, 10, 20, 30]
)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| positions | Yes | ||
| times | Yes |