ChemSharp.UnitConversion 1.0.14

.NET 5.0 .NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
Install-Package ChemSharp.UnitConversion -Version 1.0.14
dotnet add package ChemSharp.UnitConversion --version 1.0.14
<PackageReference Include="ChemSharp.UnitConversion" Version="1.0.14" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ChemSharp.UnitConversion --version 1.0.14
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ChemSharp.UnitConversion, 1.0.14"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install ChemSharp.UnitConversion as a Cake Addin
#addin nuget:?package=ChemSharp.UnitConversion&version=1.0.14

// Install ChemSharp.UnitConversion as a Cake Tool
#tool nuget:?package=ChemSharp.UnitConversion&version=1.0.14
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

<p align="center"> <img src="https://raw.githubusercontent.com/JensKrumsieck/ChemSharp/master/icon.png" height="125px" /></p> <h1 align="center" >ChemSharp.UnitConversion</h1>

NuGet Badge

Features

  • Unit Conversion for (Energy, Magnetic Units, Mass)

Basic Usage

Use given Converter:

//create converter instance (energy)
var converter = new EnergyUnitConverter("nm", "cm^-1");
//convert using Convert or ConvertInverted
var wavenumbers = converter.Convert(500) / 1000;
var nanometers = converter.ConvertInverted(50000) * 1000

Create own Converter EnergyUnitConverter:

namespace ChemSharp.UnitConversion
{
    public class EnergyUnitConverter : AbstractUnitConverter
    {
        public EnergyUnitConverter(string from, string to) : base(from, to)
        {
            AddConversion("J", 1);
            AddConversion("eV", Constants.ElectronCharge);
            AddConversion("kJ/mol", 1000 / Constants.Avogadro);
            AddConversion("cal", 4.184);
            AddConversion("kcal/mol", 4184 / Constants.Avogadro);
            AddConversion("hartree", Constants.Hartree);
            AddConversion("cm^-1", Constants.Planck * Constants.SpeedOfLight * 100);
            AddConversion("Hz", Constants.Planck);
            AddConversion("Kelvin", Constants.Boltzmann);
            AddConversion("nm", new MappedFunction()
            {
                Function = i => Constants.Planck * Constants.SpeedOfLight / (i * 1e-9),
                Reciprocal = true
            });
        }
    }
}
Compatibility
  • .NET Standard 2.0, .NET Standard 2.1, .NET 5, .NET 6
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0-beta.1 41 5/16/2022
1.0.15 81 1/27/2022
1.0.14 66 1/24/2022
1.0.13 106 12/5/2021
1.0.12 91 12/5/2021
1.0.11 2,798 11/25/2021
1.0.10 126 8/6/2021
1.0.9 153 7/2/2021
1.0.8 169 6/18/2021
1.0.7 173 6/16/2021
1.0.6 129 5/20/2021
1.0.5 163 5/20/2021
1.0.4 236 4/4/2021
1.0.3 155 3/30/2021
1.0.2 128 3/29/2021
1.0.1 153 3/9/2021
1.0.0 129 3/2/2021
1.0.0-beta5 124 2/20/2021
1.0.0-beta4 128 2/16/2021
1.0.0-beta3 169 2/11/2021
1.0.0-beta2 123 2/6/2021
1.0.0-beta1 140 2/4/2021
1.0.0-alpha20210123 186 1/23/2021
1.0.0-alpha20210105 162 1/6/2021
1.0.0-alpha1 263 12/28/2020