22 lines
555 B
C#
22 lines
555 B
C#
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;
|
|
}
|
|
}
|
|
}
|