calculate_instantaneous_velocity
Calculate velocity at a specific time using position-time data. Uses interpolation between data points or numerical differentiation to determine instantaneous velocity vector and speed magnitude.
Instructions
Calculate instantaneous velocity at a specific time.
Uses interpolation if target_time is between data points,
otherwise uses numerical differentiation.
Args:
positions: Position vectors [[x,y,z], ...] in meters (or JSON string)
times: Time values in seconds (or JSON string)
target_time: Time at which to calculate velocity in seconds
Returns:
Dict containing:
- velocity: Velocity vector [x,y,z] in m/s
- speed: Speed magnitude in m/s
- interpolated: Whether interpolation was used
- time: Target time (echo)
Example:
result = await calculate_instantaneous_velocity(
positions=[[0,0,0], [3,4,0], [6,8,0]],
times=[0, 1, 2],
target_time=1.0
)
# speed = 5 m/s
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| positions | Yes | ||
| times | Yes | ||
| target_time | Yes |