---
title: "velocity(fromValue:toValue:initialVelocity:time:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/spring/velocity(fromvalue:tovalue:initialvelocity:time:)"
---

# velocity(fromValue:toValue:initialVelocity:time:)

Calculates the velocity of the spring at a given time given a starting and ending value for the spring to travel.

## Declaration

```swift
func velocity<V>(fromValue: V, toValue: V, initialVelocity: V, time: TimeInterval) -> V where V : Animatable
```

## See Also

### Getting spring state

- [value(target:initialVelocity:time:)](swiftui/spring/value(target:initialvelocity:time:).md)
- [value(fromValue:toValue:initialVelocity:time:)](swiftui/spring/value(fromvalue:tovalue:initialvelocity:time:).md)
- [velocity(target:initialVelocity:time:)](swiftui/spring/velocity(target:initialvelocity:time:).md)
