[英]How would I reverse this equation?
I'm using this equation to convert steps to estimated calories lost. 我正在使用此方程式将步骤转换为估计的卡路里损失。
I now need to do the opposite and convert total calories to estimated steps. 我现在需要做相反的事情,并将总卡路里转换为估计的步数。
This is the equation I'm using for steps to calories: 这是我用来计算卡路里的方程式:
+(CGFloat) totalCalories:(NSUInteger)TotalStepsTaken weight:(CGFloat)PersonsWeight{
CGFloat TotalMinutesElapsed = (float)TotalStepsTaken / AverageStepsPerMinute; //Average Steps Per Minute is Equal to 100
CGFloat EstimatedCaloriesBurned = PersonsWeight * TotalMinutesElapsed * Walking3MphRate; //Walking3MphRate = 0.040;
return EstimatedCaloriesBurned;
}
It's written in Objective-C, but I tried to make it as readable as possible. 它是用Objective-C编写的,但是我试图使其尽可能地可读。
All calculations are being done over a 1 hour period. 所有计算均在1小时内完成。
Thank you for you help. 谢谢你的帮助。
这是代数,我不知道Obj-C语法...
Steps = round( Calories * StepsPerMinute / (Weight * WalkRate) );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.