Rename tss2 to tss
This commit is contained in:
parent
d274ea69a9
commit
dcf851294d
|
|
@ -2,7 +2,7 @@ import { Workout } from "../ast";
|
||||||
import { averageIntensity } from "./averageIntensity";
|
import { averageIntensity } from "./averageIntensity";
|
||||||
import { normalizedIntensity } from "./normalizedIntensity";
|
import { normalizedIntensity } from "./normalizedIntensity";
|
||||||
import { totalDuration } from "./totalDuration";
|
import { totalDuration } from "./totalDuration";
|
||||||
import { tss2 } from "./tss2";
|
import { tss } from "./tss";
|
||||||
import { zoneDistribution } from "./zoneDistribution";
|
import { zoneDistribution } from "./zoneDistribution";
|
||||||
|
|
||||||
// Generates statistics
|
// Generates statistics
|
||||||
|
|
@ -18,7 +18,7 @@ Total duration: ${(duration.seconds / 60).toFixed()} minutes
|
||||||
Average intensity: ${(avgIntensity.value * 100).toFixed()}%
|
Average intensity: ${(avgIntensity.value * 100).toFixed()}%
|
||||||
Normalized intensity: ${(normIntensity.value * 100).toFixed()}%
|
Normalized intensity: ${(normIntensity.value * 100).toFixed()}%
|
||||||
|
|
||||||
TSS: ${tss2(duration, normIntensity).toFixed()}
|
TSS: ${tss(duration, normIntensity).toFixed()}
|
||||||
|
|
||||||
Zone Distribution:
|
Zone Distribution:
|
||||||
${zones.map(({ name, duration }) => `${(duration.seconds / 60).toFixed().padStart(3)} min - ${name}`).join("\n")}
|
${zones.map(({ name, duration }) => `${(duration.seconds / 60).toFixed().padStart(3)} min - ${name}`).join("\n")}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,6 @@ import { Intensity } from "../Intensity";
|
||||||
// TSS = (s * (FTP * IF) * IF) / (FTP * 3600) * 100
|
// TSS = (s * (FTP * IF) * IF) / (FTP * 3600) * 100
|
||||||
// TSS = (s * IF * IF) / 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;
|
return ((duration.seconds * Math.pow(intensity.value, 2)) / 3600) * 100;
|
||||||
};
|
};
|
||||||
Loading…
Reference in New Issue