diff --git a/src/stats/index.ts b/src/stats/index.ts index 1570606..773eca3 100644 --- a/src/stats/index.ts +++ b/src/stats/index.ts @@ -2,7 +2,7 @@ import { Workout } from "../ast"; import { averageIntensity } from "./averageIntensity"; import { normalizedIntensity } from "./normalizedIntensity"; import { totalDuration } from "./totalDuration"; -import { tss2 } from "./tss2"; +import { tss } from "./tss"; import { zoneDistribution } from "./zoneDistribution"; // Generates statistics @@ -18,7 +18,7 @@ Total duration: ${(duration.seconds / 60).toFixed()} minutes Average intensity: ${(avgIntensity.value * 100).toFixed()}% Normalized intensity: ${(normIntensity.value * 100).toFixed()}% -TSS: ${tss2(duration, normIntensity).toFixed()} +TSS: ${tss(duration, normIntensity).toFixed()} Zone Distribution: ${zones.map(({ name, duration }) => `${(duration.seconds / 60).toFixed().padStart(3)} min - ${name}`).join("\n")} diff --git a/src/stats/tss2.ts b/src/stats/tss.ts similarity index 87% rename from src/stats/tss2.ts rename to src/stats/tss.ts index 747df35..fe1237b 100644 --- a/src/stats/tss2.ts +++ b/src/stats/tss.ts @@ -14,6 +14,6 @@ import { Intensity } from "../Intensity"; // TSS = (s * (FTP * IF) * IF) / (FTP * 3600) * 100 // TSS = (s * IF * IF) / 3600 * 100 -export const tss2 = (duration: Duration, intensity: Intensity): number => { +export const tss = (duration: Duration, intensity: Intensity): number => { return ((duration.seconds * Math.pow(intensity.value, 2)) / 3600) * 100; };