Skip to content

Commit

Permalink
Added a method to convert mach to km/h (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed May 6, 2023
1 parent 0ffc517 commit 13bea9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions PeyrSharp.Core/Converters/Speeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,14 @@ public static class Speeds
/// <param name="kilometersPerHour">The speed in kilometers per hour.</param>
/// <returns>The equivalent speed in miles per hour.</returns>
public static double KilometersPerHourToMilesPerHour(double kilometersPerHour) => kilometersPerHour / 1.60934;

/// <summary>
/// Converts a speed in mach to a speed in kilometers per hour.
/// </summary>
/// <param name="n">The speed in mach to convert.</param>
/// <returns>The speed in kilometers per hour equivalent to n mach.</returns>
public static double MachToKilometersPerHour(double n) =>
// Use the conversion formula: km/h = mach * 1234.8
n * 1234.8;
}
}

0 comments on commit 13bea9c

Please sign in to comment.