public Volume Convert(VolumeUnit volumeUnit) { var width = volumeUnit.BaseUnit.Convert(Width); var height = volumeUnit.BaseUnit.Convert(Height); var depth = volumeUnit.BaseUnit.Convert(Depth); return(new Volume(width.Value, height.Value, depth.Value, volumeUnit)); }
public double Calculate(VolumeUnit volumeUnit) { var volume = volumeUnit.Convert(this); return(volume.Width.Value * volume.Height.Value * volume.Depth.Value); }
public Volume(double width, double height, double depth, VolumeUnit volumeUnit) { Width = new Length(width, volumeUnit.BaseUnit); Height = new Length(height, volumeUnit.BaseUnit); Depth = new Length(depth, volumeUnit.BaseUnit); }