# How to calculate Distance Per Stroke for SUP

I did a SUP activity with my Garmin Watch today.
GC shows me the `Stroke Rate (spm)` and the `Distance Per Stroke (m)`.

The Fit File Contains

``````timestamp,
position_lat(°)
position_long(°)
distance(m)
enhanced_speed(m/s)
heart_rate(bpm)
``````

In intervals.icu I can select `Cadence` (which is exactly the Stroke Rate)
I can also select Stride, which seems to be half the value of `Distance Per Stroke` as shown in GC.

I tried a bit to create a new Custom Stream, `Distance Per Stroke = Stride / 2`, and also to calculate `Stride` by myself, but both approaches failed.

Can someone give me a hint on how I can get my desired metric?

Here is code for a custom stream that calculates average distance per stroke over an approximately 60s window. I don’t know enough about SUP to tell if the numbers are good. If it is good please add a description and share it.

``````{
let distance = icu.streams.distance
let time = icu.streams.time
let window = 60
for (let i = 0; i < window; i++) totCadence += cadence[i]
for (let i = window; i < data.length; i++) {
let secs = time[i] - time[i - window]
let m = distance[i] - distance[i - window]
if (secs < window + 5) {
let strokes = (avgCadence / 60.0) * secs
if (strokes) {
let v = m / strokes
if (v < 10) data[i] = v
}
}