Skip to content

Commit c6831d1

Browse files
tmilnthorpangularsen
authored andcommitted
Add charge density for surface (C/m²) (#640)
1 parent de38769 commit c6831d1

15 files changed

+1679
-4
lines changed

Common/UnitDefinitions/ElectricChargeDensity.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Name": "ElectricChargeDensity",
33
"BaseUnit": "CoulombPerCubicMeter",
4-
"XmlDoc": "In electromagnetism, charge density is a measure of the amount of electric charge per unit length, surface area, or volume.",
4+
"XmlDoc": "In electromagnetism, charge density is a measure of the amount of electric charge per volume.",
55
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Charge_density",
66
"BaseDimensions": {
77
"L": -3,
@@ -12,6 +12,11 @@
1212
{
1313
"SingularName": "CoulombPerCubicMeter",
1414
"PluralName": "CoulombsPerCubicMeter",
15+
"BaseUnits": {
16+
"L": "Meter",
17+
"T": "Second",
18+
"I": "Ampere"
19+
},
1520
"FromUnitToBaseFunc": "x",
1621
"FromBaseToUnitFunc": "x",
1722
"Localization": [
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"Name": "ElectricSurfaceChargeDensity",
3+
"BaseUnit": "CoulombPerSquareMeter",
4+
"XmlDoc": "In electromagnetism, surface charge density is a measure of the amount of electric charge per surface area.",
5+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Charge_density",
6+
"BaseDimensions": {
7+
"L": -2,
8+
"T": 1,
9+
"I": 1
10+
},
11+
"Units": [
12+
{
13+
"SingularName": "CoulombPerSquareMeter",
14+
"PluralName": "CoulombsPerSquareMeter",
15+
"BaseUnits": {
16+
"L": "Meter",
17+
"T": "Second",
18+
"I": "Ampere"
19+
},
20+
"FromUnitToBaseFunc": "x",
21+
"FromBaseToUnitFunc": "x",
22+
"Localization": [
23+
{
24+
"Culture": "en-US",
25+
"Abbreviations": [ "C/m²" ]
26+
}
27+
]
28+
},
29+
{
30+
"SingularName": "CoulombPerSquareCentimeter",
31+
"PluralName": "CoulombsPerSquareCentimeter",
32+
"BaseUnits": {
33+
"L": "Centimeter",
34+
"T": "Second",
35+
"I": "Ampere"
36+
},
37+
"FromUnitToBaseFunc": "x * 1.0e4",
38+
"FromBaseToUnitFunc": "x / 1.0e4",
39+
"Localization": [
40+
{
41+
"Culture": "en-US",
42+
"Abbreviations": [ "C/cm²" ]
43+
}
44+
]
45+
},
46+
{
47+
"SingularName": "CoulombPerSquareInch",
48+
"PluralName": "CoulombsPerSquareInch",
49+
"BaseUnits": {
50+
"L": "Inch",
51+
"T": "Second",
52+
"I": "Ampere"
53+
},
54+
"FromUnitToBaseFunc": "x * 1.5500031000062000e3",
55+
"FromBaseToUnitFunc": "x / 1.5500031000062000e3",
56+
"Localization": [
57+
{
58+
"Culture": "en-US",
59+
"Abbreviations": [ "C/in²" ]
60+
}
61+
]
62+
}
63+
]
64+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated (once) by \generate-code.bat, but will not be
4+
// regenerated when it already exists. The purpose of creating this file is to make
5+
// it easier to remember to implement all the unit conversion test cases.
6+
//
7+
// Whenever a new unit is added to this quantity and \generate-code.bat is run,
8+
// the base test class will get a new abstract property and cause a compile error
9+
// in this derived class, reminding the developer to implement the test case
10+
// for the new unit.
11+
//
12+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
13+
//
14+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
15+
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
16+
//
17+
// </auto-generated>
18+
//------------------------------------------------------------------------------
19+
20+
// Licensed under MIT No Attribution, see LICENSE file at the root.
21+
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.
22+
23+
using System;
24+
25+
namespace UnitsNet.Tests.CustomCode
26+
{
27+
public class ElectricSurfaceChargeDensityTests : ElectricSurfaceChargeDensityTestsBase
28+
{
29+
protected override double CoulombsPerSquareMeterInOneCoulombPerSquareMeter => 1.0;
30+
31+
protected override double CoulombsPerSquareCentimeterInOneCoulombPerSquareMeter => 1.0e-4;
32+
33+
protected override double CoulombsPerSquareInchInOneCoulombPerSquareMeter => 6.4516e-4;
34+
}
35+
}

UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)