Closed tm-ren closed 1 year ago
Hi, this should be straight forward to add. Would you be interested in attempting a pull request? I'm happy to assist.
UnitsNet/CustomCode/Quantities/CoefficientOfThermalExpansion.extra.cs
and add the first method there. See how other files do it.Also propose inclusion of additional units to the CoefficientOfThermalExpansion type, e.g. "PartsPerMillionPerDegreesCelsius".
Hi, this should be straight forward to add. Would you be interested in attempting a pull request? I'm happy to assist.
- Create
UnitsNet/CustomCode/Quantities/CoefficientOfThermalExpansion.extra.cs
and add the first method there. See how other files do it.- Add the second method to the existing file: https://github.com/angularsen/UnitsNet/blob/master/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs
Yes happy to contribute if you can give me a bit of guidance for your process?
I have two change branches for the above but I don't have write access to the project to be able to push and create pull requests. Are you able to give me write access?
Sorry for late reply, was on vacation.
There are detailed steps here on adding units: https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit
As for write access; see this section: https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit#6-create-pull-request
A typical use case for a coefficient of thermal expansion is to calculate a change in length due to a change in temperature.
dL = (cte * dT) * L;
dL
is a change in length.cte
is a coefficient of thermal expansion.dT
is a temperature delta, the change in temperature from some reference temperature.L
is a length at the reference temperature.It would be useful if there were operators of the form:
public static double operator * (CoefficientOfThermalExpansion cte, TemperatureDelta dt)
And:public static double operator * (TemperatureDelta dt, CoefficientOfThermalExpansion cte)