Closed rjs5327 closed 2 months ago
Also Please Add to the Documentation a example of how to do the math. I found a work around on this. I feel that should be in the about page since the .Kilograms converts it to a double value that then can be used.
public static MassMomentOfInertia SolidCylinderInertia(Mass mass, Length radius)
{
return MassMomentOfInertia.FromKilogramSquareMillimeters( mass.Kilograms * radius.Millimeters * radius.Millimeters / 2.0);
}
Also some documentation on Why this is not allowed
public static Torque TorqueAcc(MassMomentOfInertia InertiaTotal, RotationalAcceleration Rad_Sec2, Torque FrictionTorque)
{
// Does not Work - Throws a error Torque torque = InertiaTotal* Rad_Sec2; return torque + FrictionTorque; }
But this works and is allowed
public static MassMomentOfInertia BallScrewInertia(Length Diameter, Length Length, Density density)
{
Volume screwVolume = Volume.FromCubicMillimeters(Math.PI * (Diameter.Millimeters / 2)* (Diameter.Millimeters / 2) * Length.Millimeters);
Mass mass = density*screwVolume;
return SolidCylinderInertia(mass, Diameter / 2);
}
Both ways there is a * used but one is ok and the other is not allowed . I see it as best practice is to not rely on it working but i dont follow why it works and does not work
Sorry for late reply. This question is not clear to me.
All multiplication and division operator overloads are manually added, so we can add more if something is missing.
For example, see how Length.extra.cs
defines arithmetic between different quantities relating to itself:
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was automatically closed due to inactivity.
Is your feature request related to a problem? Please describe. Allow for there to be math between units to make combined units Torque = Force * Length
Basically adding in the unknown unit classes from the https://github.com/MadsKirkFoged/EngineeringUnits library and adding this function to Units Test