Ejemplo n.º 1
0
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="Mass"/> that is the result from the division.</returns>
 public static Mass operator /(Volume left, SpecificVolume right)
 {
     return(Mass.FromKilograms(left.cubicMetres / right.cubicMetresPerKilogram));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="Mass"/> that is the result from the division.</returns>
 public static Mass operator /(Force left, Acceleration right)
 {
     return(Mass.FromKilograms(left.newtons / right.metresPerSecondSquared));
 }
Ejemplo n.º 3
0
 public bool Equals(Mass other, Mass tolerance)
 {
     Ensure.GreaterThan(tolerance.kilograms, 0, nameof(tolerance));
     return(Math.Abs(this.kilograms - other.kilograms) < tolerance.kilograms);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Multiplies <paramref name="left"/> with <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="Mass"/> that is the result from the multiplication.</returns>
 public static Mass operator *(Volume left, Density right)
 {
     return(Mass.FromKilograms(left.cubicMetres * right.kilogramsPerCubicMetre));
 }
Ejemplo n.º 5
0
 public int CompareTo(Mass quantity)
 {
     return(this.kilograms.CompareTo(quantity.kilograms));
 }
Ejemplo n.º 6
0
 public bool Equals(Mass other)
 {
     return(this.kilograms.Equals(other.kilograms));
 }
Ejemplo n.º 7
0
 public static bool TryParse(string text, NumberStyles styles, IFormatProvider provider, out Mass result)
 {
     return(QuantityParser.TryParse <MassUnit, Mass>(text, From, styles, provider, out result));
 }
Ejemplo n.º 8
0
 public static bool TryParse(string text, NumberStyles styles, out Mass result)
 {
     return(QuantityParser.TryParse <MassUnit, Mass>(text, From, styles, CultureInfo.CurrentCulture, out result));
 }
Ejemplo n.º 9
0
 public static Mass operator *(Time left, MassFlow right)
 {
     return(Mass.FromKilograms(left.seconds * right.kilogramsPerSecond));
 }
Ejemplo n.º 10
0
 public static Mass operator *(MolarMass left, AmountOfSubstance right)
 {
     return(Mass.FromKilograms(left.kilogramsPerMole * right.moles));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="Mass"/> that is the result from the division.</returns>
 public static Mass operator /(Energy left, SpecificEnergy right)
 {
     return(Mass.FromKilograms(left.joules / right.joulesPerKilogram));
 }