Skip to content

Mass from LinearDensity and Length #1250

@HakonJohannessen

Description

@HakonJohannessen

Hi :)

When working with linear densities and lengths it would be great to have at least a built in * (multiplication) operator for converting into mass.

As an example, consider a type of steel pipe with a linear density of 10kilograms / meter, now I produce 100 meters of this pipe and would like to know the total weight (mass): 10kilograms / meter * 100 meters = 1000 kilograms.

/// <summary>Get <see cref="Mass"/> from <see cref="LinearDensity"/> times <see cref="Length"/>.</summary>
public static Mass operator *(LinearDensity linearDensity, Length length)
{
     return Mass.FromKilograms(linearDensity.KilogramsPerMeter * length.Meters);
}

I would have liked to see something like this implemented in a future version.
Anyway, thank you all for making and maintaining this project <3

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions