Skip to content

wiwalsh/EngineeringUnits

 
 

Repository files navigation

EngineeringUnits

This is an (almost) interchangeable version of UnitsNet which mean you just have to change the using if you already use UnitsNet

//using UnitsNet;
//using UnitsNet.Units;

using EngineeringUnits;
using EngineeringUnits.Units;

Comparing UnitsNet and EngineeringUnits

✔️ EngineeringUnits can handle mathematical operations (+-*/) between any unit
SpecificEntropy P1 = new SpecificEntropy(1, SpecificEntropyUnit.JoulePerKilogramKelvin);
MassFlow M1 = new MassFlow(1, MassFlowUnit.KilogramPerSecond);
Temperature T2 = new Temperature(10, TemperatureUnit.DegreeCelsius);
Temperature T1 = new Temperature(5, TemperatureUnit.DegreeCelsius);

//UnitsNet cant do this..
Power Q1 = M1 * P1 * (T2 - T1);
✔️ Temperature calculations are done just like any other unit (TemperatureDelta has been removed!)
✔️ Units can have alias. Ex SpecificEnergy and Enthalpy are the same thing and you can just choose the one you normally use. (No code duplication for this option!)
✔️ More precise convertions:
Length L2 = new Length(1, LengthUnit.Mile);
Correct result in Inch:   63360

EngineeringUnits in Inch: 63360
UnitsNet in Inch:         63359,84251968504
🚩 Unit checks has been moved from Compile time to runtime. In UnitsNet if you do mathematical operations on units that doesnt turn into the expected unit, you're get an error before you compile the program. In EngineeringUnits you still have the same check but you will get the error when you run the program.

Should I change from UnitsNet to EngineeringUnits?

✔️ If you are working with engineering-, physics- , chemical- equations then EngineeringUnits will make your life easier
🚩 If you are just making converions ( Meter -> Inch) and you dont care about the extra precision then UnitsNet and EngineeringUnits are identical.

How to install

✔️ Nuget Package: EngineeringUnits

The future of EngineeringUnits

✅ Create Unittests to compare everything in UnitsNet and EngineeringUnits
🟩 Optimize code for faster execution time
🟩 Refactor parts of the code that are 'not too well written'
🟩 Create more alias for units which have the same baseunit but have different names
🟩 Create class with all commonly used physical constants (speed of light, Planck constant, Boltzmann constant.. etc)
🟩 Make EngineeringUnits and UnitsNet even more interchangeable
🟩 Fix all user reported bug
🟩 Add user requested functionality
🟩 Write a 'Getting started with EngineeringUnits' document
🟩 Show more user code examples of EngineeringUnits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%