-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from Leo-Corporation/vNext
Version 1.4.0.2303
- Loading branch information
Showing
11 changed files
with
209 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
MIT License | ||
Copyright (c) Léo Corporation | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace PeyrSharp.Core.Converters | ||
{ | ||
/// <summary> | ||
/// Class that contains energies converters methods. | ||
/// </summary> | ||
public static class Energies | ||
{ | ||
/// <summary> | ||
/// Converts calories to joules. | ||
/// </summary> | ||
/// <param name="calories">The amount of energy in calories.</param> | ||
/// <returns>The equivalent amount of energy in joules.</returns> | ||
public static double CaloriesToJoules(double calories) => | ||
// 1 calorie = 4.184 joules | ||
calories * 4.184; | ||
|
||
/// <summary> | ||
/// Converts joules to calories. | ||
/// </summary> | ||
/// <param name="joules">The amount of energy in joules.</param> | ||
/// <returns>The equivalent amount of energy in calories.</returns> | ||
public static double JoulesToCalories(double joules) => | ||
// 1 calorie = 4.184 joules | ||
joules / 4.184; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
MIT License | ||
Copyright (c) Léo Corporation | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace PeyrSharp.Core.Converters | ||
{ | ||
/// <summary> | ||
/// Class that contains speeds converters methods. | ||
/// </summary> | ||
public static class Speeds | ||
{ | ||
/// <summary> | ||
/// Converts knots to kilometers per hour. | ||
/// </summary> | ||
/// <param name="knots">The speed in knots.</param> | ||
/// <returns>The equivalent speed in kilometers per hour.</returns> | ||
public static double KnotsToKilometersPerHour(double knots) => knots * 1.852; | ||
|
||
/// <summary> | ||
/// Converts kilometers per hour to knots. | ||
/// </summary> | ||
/// <param name="kilometersPerHour">The speed in kilometers per hour.</param> | ||
/// <returns>The equivalent speed in knots.</returns> | ||
public static double KilometersPerHourToKnots(double kilometersPerHour) => kilometersPerHour / 1.852; | ||
|
||
/// <summary> | ||
/// Converts knots to miles per hour. | ||
/// </summary> | ||
/// <param name="knots">The speed in knots.</param> | ||
/// <returns>The equivalent speed in miles per hour.</returns> | ||
public static double KnotsToMilesPerHour(double knots) => knots * 1.15078; | ||
|
||
/// <summary> | ||
/// Converts miles per hour to knots. | ||
/// </summary> | ||
/// <param name="milesPerHour">The speed in miles per hour.</param> | ||
/// <returns>The equivalent speed in knots.</returns> | ||
public static double MilesPerHourToKnots(double milesPerHour) => milesPerHour / 1.15078; | ||
|
||
/// <summary> | ||
/// Converts kilometers per hour to meters per second. | ||
/// </summary> | ||
/// <param name="kilometersPerHour">The speed in kilometers per hour.</param> | ||
/// <returns>The equivalent speed in meters per second.</returns> | ||
public static double KilometersPerHourToMetersPerSecond(double kilometersPerHour) => kilometersPerHour / 3.6; | ||
|
||
/// <summary> | ||
/// Converts meters per second to kilometers per hour. | ||
/// </summary> | ||
/// <param name="metersPerSecond">The speed in meters per second.</param> | ||
/// <returns>The equivalent speed in kilometers per hour.</returns> | ||
public static double MetersPerSecondToKilometersPerHour(double metersPerSecond) => metersPerSecond * 3.6; | ||
|
||
/// <summary> | ||
/// Converts miles per hour to kilometers per hour. | ||
/// </summary> | ||
/// <param name="milesPerHour">The speed in miles per hour.</param> | ||
/// <returns>The equivalent speed in kilometers per hour.</returns> | ||
public static double MilesPerHourToKilometersPerHour(double milesPerHour) => milesPerHour * 1.60934; | ||
|
||
/// <summary> | ||
/// Converts kilometers per hour to miles per hour. | ||
/// </summary> | ||
/// <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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters