Use this file to discover all available pages before exploring further.
FocusFlow’s workout math utilities, located in src/utils/workoutMath.ts, provide pure functions for estimating one-rep maxima and generating percentage-based load tables. These functions power the in-app 1RM calculator and the progressive overload suggestions shown to both coaches and athletes during session planning.
All three functions are fully tree-shakeable exports. Import only the functions you need to keep client bundles lean.
Calculates the estimated one-repetition maximum (1RM) from a sub-maximal lift using either the Epley or Brzycki formula. This is the foundational building block used by both getRMPercentage and generateRMTable.
export function calculate1RM( weight: number, reps: number, formula: 'epley' | 'brzycki' = 'epley'): number
The estimated 1RM rounded to 1 decimal place. Returns 0 if weight ≤ 0 or reps ≤ 0. Returns weight unchanged when reps === 1 (the lift itself is the 1RM).
Brzycki’s denominator approaches zero as reps approach 37. When reps ≥ 37, FocusFlow automatically falls back to the Epley formula to avoid a division-by-zero or negative result.
import { calculate1RM, getRMPercentage } from './utils/workoutMath';const oneRM = calculate1RM(80, 5, 'epley'); // 93.3// Target weight for an 80% intensity setconst targetWeight = getRMPercentage(oneRM, 80);// => 74.6// Warm-up set at 60%const warmUp = getRMPercentage(oneRM, 60);// => 56.0
Pair getRMPercentage with the intensity field on RoutineExercise to auto-fill suggested weights when the coach prescribes a load as a percentage of the athlete’s last tested 1RM.
Generates a full 12-entry repetition-maximum table from a single sub-maximal effort. Each entry maps a rep count (1–12) to the corresponding recommended weight and percentage of 1RM, using the standard strength-training percentage map.