powerfun-unity/Assets/Scripts/Devices/DoubleExtensions.cs

22 lines
555 B
C#
Raw Normal View History

2021-04-01 09:33:19 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Devices
{
public static class DoubleExtensions
{
public static double CalculateSpeed(this int wheelRpm, double wheelCircumference)
{
return (double)wheelRpm * (wheelCircumference / 1000.0) * 0.06;
}
public static double MetersPerSecondToKmh(this double metersPerSecond)
{
return metersPerSecond * 60.0 * 60.0 / 1000.0;
}
}
}