- Notifications
You must be signed in to change notification settings - Fork 416
Added units for Astronomy.#680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
85d8c1674663b8a846f9a4b9a40e6778b39ea27c15467ccbbb7a05c3430f943bac7b78c31f9551423b8dcc2c680File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "Name": "Luminosity", | ||
| "BaseUnit": "Watt", | ||
| "BaseType": "double", | ||
| "XmlDoc": "Luminosity is an absolute measure of radiated electromagnetic power (light), the radiant power emitted by a light-emitting object.", | ||
| "XmlDocRemarks": "https://en.wikipedia.org/wiki/Luminosity", | ||
| "BaseDimensions": { | ||
| "L": 2, | ||
| "M": 1, | ||
| "T": -3 | ||
| }, | ||
| "Units": [ | ||
| { | ||
| "SingularName": "Watt", | ||
| "PluralName": "Watts", | ||
| "FromUnitToBaseFunc": "x", | ||
| "FromBaseToUnitFunc": "x", | ||
| "Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera", "Peta" ], | ||
| "Localization": [ | ||
| { | ||
| "Culture": "en-US", | ||
| "Abbreviations": [ "W" ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "SingularName": "SolarLuminosity", | ||
| "PluralName": "SolarLuminosities", | ||
| "FromUnitToBaseFunc": "x * 3.846e26", | ||
| "FromBaseToUnitFunc": "x / 3.846e26", | ||
| "XmlDocRemarks": "https://www.britannica.com/science/luminosity", | ||
| "Localization": [ | ||
| { | ||
| "Culture": "en-US", | ||
| "Abbreviations": [ "L⊙" ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -210,6 +210,40 @@ | ||
| "Abbreviations": [ "gr" ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "SingularName": "SolarMass", | ||
| "PluralName": "SolarMasses", | ||
| "BaseUnits": { | ||
| "M": "SolarMass" | ||
| }, | ||
| "FromUnitToBaseFunc": "x * 1.98947e30", | ||
| "FromBaseToUnitFunc": "x / 1.98947e30", | ||
| "XmlDocSummary": "Solar mass is a ratio unit to the mass of the solar system star, the sun.", | ||
| "XmlDocRemarks": "https://en.wikipedia.org/wiki/Solar_mass", | ||
| "Localization": [ | ||
| { | ||
| "Culture": "en-US", | ||
| "Abbreviations": [ "M⊙" ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "SingularName": "EarthMass", | ||
| "PluralName": "EarthMasses", | ||
| "BaseUnits": { | ||
angularsen marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| "M": "EarthMass" | ||
| }, | ||
| "FromUnitToBaseFunc": "x * 5.9722E+24", | ||
| "FromBaseToUnitFunc": "x / 5.9722E+24", | ||
| "XmlDocSummary": "Earth mass is a ratio unit to the mass of planet Earth.", | ||
| "XmlDocRemarks": "https://en.wikipedia.org/wiki/Earth_mass", | ||
| "Localization": [ | ||
| { | ||
| "Culture": "en-US", | ||
| "Abbreviations": [ "em" ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -57,6 +57,20 @@ public class LengthTests : LengthTestsBase | ||
| protected override double HandsInOneMeter => 9.8425196850393701; | ||
| protected override double AstronomicalUnitsInOneMeter => 6.6845871222684500000000000E-12; | ||
| protected override double KilolightYearsInOneMeter => 1.0570008340247000000000000E-19; | ||
| protected override double KiloparsecsInOneMeter => 3.2407790389471100000000000E-20; | ||
| protected override double LightYearsInOneMeter => 1.0570008340247000000000000E-16; | ||
| protected override double MegalightYearsInOneMeter => 1.0570008340247000000000000E-22; | ||
| protected override double MegaparsecsInOneMeter => 3.2407790389471100000000000E-23; | ||
| protected override double ParsecsInOneMeter => 3.2407790389471100000000000E-17; | ||
ebfortin marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
angularsen marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| [ Fact] | ||
| public void AreaTimesLengthEqualsVolume() | ||
| { | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| //------------------------------------------------------------------------------ | ||
| // <auto-generated> | ||
| // This code was generated by \generate-code.bat. | ||
| // | ||
| // Changes to this file will be lost when the code is regenerated. | ||
| // The build server regenerates the code before each build and a pre-build | ||
| // step will regenerate the code on each local build. | ||
| // | ||
| // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. | ||
| // | ||
| // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. | ||
| // Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. | ||
| // | ||
| // </auto-generated> | ||
| //------------------------------------------------------------------------------ | ||
| // Licensed under MIT No Attribution, see LICENSE file at the root. | ||
| // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. | ||
| using System; | ||
| namespace UnitsNet.Tests.CustomCode | ||
| { | ||
| public class LuminosityTests : LuminosityTestsBase | ||
| { | ||
| // Override properties in base class here | ||
| protected override double FemtowattsInOneWatt => 1e15; | ||
| protected override double PicowattsInOneWatt => 1e12; | ||
| protected override double NanowattsInOneWatt => 1e9; | ||
| protected override double MicrowattsInOneWatt => 1e6; | ||
| protected override double MilliwattsInOneWatt => 1e3; | ||
| protected override double DeciwattsInOneWatt => 1e1; | ||
| protected override double WattsInOneWatt => 1; | ||
| protected override double DecawattsInOneWatt => 1e-1; | ||
| protected override double KilowattsInOneWatt => 1e-3; | ||
| protected override double MegawattsInOneWatt => 1e-6; | ||
| protected override double GigawattsInOneWatt => 1e-9; | ||
| protected override double TerawattsInOneWatt => 1e-12; | ||
| protected override double PetawattsInOneWatt => 1e-15; | ||
| protected override double SolarLuminositiesInOneWatt => 2.6001040041601700000000000E-27; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -57,6 +57,12 @@ public class MassTests : MassTestsBase | ||
| protected override double ShortHundredweightInOneKilogram => 0.022046226218487758; | ||
| protected override double EarthMassesInOneKilogram => 1.6744248350691500000000000E-25; | ||
ebfortin marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| protected override double SolarMassesInOneKilogram => 5.0264643347223100000000000E-31; | ||
angularsen marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| //protected override double SolarMassesTolerance => 0.1; | ||
| [Fact] | ||
| public void AccelerationTimesMassEqualsForce() | ||
| { | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.