Skip to content

Commit 38dac48

Browse files
committed
fixed calories burnt calculation formula
1 parent 6bca246 commit 38dac48

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

godot/Workout/Wourkout.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class Workout {
2222
public float averageWatts;
2323
public float caloriesBurnt;
2424
const float humanMetabolicEfficiency = .24f;
25-
const float julesToCalories = 4.184f;
25+
const float julesToCalories = 1f / 4184f;
2626

2727
public float totalAscent;
2828
public float totalDescent;
@@ -65,7 +65,8 @@ float currentHeight
6565
averageHeartRate = totalHeartRate / totalTime_s;
6666
averageSpeed_kmH = totalSpeed_kmH / totalTime_s;
6767
averageWatts = totalPower / totalTime_s;
68-
caloriesBurnt = averageWatts * totalTime_s * humanMetabolicEfficiency * julesToCalories;
68+
69+
caloriesBurnt = averageWatts * totalTime_s * julesToCalories / humanMetabolicEfficiency;
6970
}
7071

7172
public static Workout Load(string name) {

0 commit comments

Comments
 (0)