Class: Runby::RunMath

Inherits:
Object
  • Object
show all
Defined in:
lib/runby_pace/run_math.rb

Overview

An assortment of mathematical functions related to running.

Class Method Summary collapse

Class Method Details

.predict_race_time(race1_distance, race1_time, target_distance) ⇒ Object


6
7
8
9
10
11
12
# File 'lib/runby_pace/run_math.rb', line 6

def self.predict_race_time(race1_distance, race1_time, target_distance)
  race1_distance = Runby.sanitize(race1_distance).as(Distance)
  race1_time = Runby.sanitize(race1_time).as(RunbyTime)
  target_distance = Runby.sanitize(target_distance).as(Distance)

  race1_time * (target_distance / race1_distance)**1.06
end