mirror of
https://github.com/russok/FitoTrack.git
synced 2025-10-28 16:22:12 -07:00
Use running calorie calculation for hiking
This commit is contained in:
parent
4b4cb52138
commit
393fd4aba9
@ -48,14 +48,10 @@ public class CalorieCalculator {
|
||||
*/
|
||||
public static double getMET(Workout workout){
|
||||
double speedInKmh= workout.avgSpeed * 3.6;
|
||||
if(workout.workoutType.equals(Workout.WORKOUT_TYPE_RUNNING)){
|
||||
if(workout.workoutType.equals(Workout.WORKOUT_TYPE_RUNNING) || workout.workoutType.equals(Workout.WORKOUT_TYPE_HIKING)){
|
||||
// This is a linear graph based on the website linked above
|
||||
return Math.max(1.5, speedInKmh*1.117 - 2.1906);
|
||||
}
|
||||
if(workout.workoutType.equals(Workout.WORKOUT_TYPE_HIKING)){
|
||||
// Use fixed MET because no more precise calculation was found
|
||||
return 6.0;
|
||||
}
|
||||
if(workout.workoutType.equals(Workout.WORKOUT_TYPE_CYCLING)){
|
||||
// This is a linear graph based on the website linked above
|
||||
return Math.max(3, (speedInKmh-10) / 1.5);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user