コード例 #1
0
 public static Voltage operator *(Resistance left, Current right)
 {
     return(Voltage.FromVolts(left.ohm * right.amperes));
 }
コード例 #2
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="Voltage"/> that is the result from the multiplication.</returns>
 public static Voltage operator *(KinematicViscosity left, MagneticFieldStrength right)
 {
     return(Voltage.FromVolts(left.squareMetresPerSecond * right.teslas));
 }
コード例 #3
0
 public static Voltage operator *(double left, VoltageUnit right)
 {
     return(Voltage.From(left, right));
 }
コード例 #4
0
ファイル: Current.generated.cs プロジェクト: pockees/Gu.Units
 /// <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="Voltage"/> that is the result from the division.</returns>
 public static Voltage operator /(Current left, ElectricalConductance right)
 {
     return(Voltage.FromVolts(left.amperes / right.siemens));
 }
コード例 #5
0
 public static Voltage operator /(ElectricCharge left, Capacitance right)
 {
     return(Voltage.FromVolts(left.coulombs / right.farads));
 }
コード例 #6
0
ファイル: Frequency.generated.cs プロジェクト: forki/Gu.Units
 /// <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="Voltage"/> that is the result from the multiplication.</returns>
 public static Voltage operator *(Frequency left, MagneticFlux right)
 {
     return(Voltage.FromVolts(left.hertz * right.webers));
 }
コード例 #7
0
ファイル: Current.generated.cs プロジェクト: pockees/Gu.Units
 /// <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="Voltage"/> that is the result from the multiplication.</returns>
 public static Voltage operator *(Current left, Resistance right)
 {
     return(Voltage.FromVolts(left.amperes * right.ohms));
 }
コード例 #8
0
 public static Voltage operator *(MagneticFlux left, Frequency right)
 {
     return(Voltage.FromVolts(left.webers * right.hertz));
 }
コード例 #9
0
 public static Voltage operator /(MagneticFlux left, Time right)
 {
     return(Voltage.FromVolts(left.webers / right.seconds));
 }
コード例 #10
0
 /// <summary>
 /// Returns a quantity indicating whether this instance is equal to a specified <see cref="Gu.Units.Voltage"/> object.
 /// </summary>
 /// <returns>
 /// true if <paramref name="other"/> represents the same Voltage as this instance; otherwise, false.
 /// </returns>
 /// <param name="other">An instance of <see cref="Gu.Units.Voltage"/> object to compare with this instance.</param>
 public bool Equals(Voltage other)
 {
     return(this.volts.Equals(other.volts));
 }
コード例 #11
0
 /// <summary>
 /// Returns a quantity indicating whether this instance is equal to a specified <see cref="Gu.Units.Voltage"/> object within the given tolerance.
 /// </summary>
 /// <returns>
 /// true if <paramref name="other"/> represents the same Voltage as this instance; otherwise, false.
 /// </returns>
 /// <param name="other">An instance of <see cref="Gu.Units.Voltage"/> object to compare with this instance.</param>
 /// <param name="tolerance">The maximum difference for being considered equal. Must be greater than zero.</param>
 public bool Equals(Voltage other, Voltage tolerance)
 {
     Ensure.GreaterThan(tolerance.volts, 0, nameof(tolerance));
     return(Math.Abs(this.volts - other.volts) < tolerance.volts);
 }
コード例 #12
0
 /// <summary>
 /// Compares this instance to a specified <see cref="Gu.Units.Voltage"/> object and returns an integer that indicates whether this <paramref name="quantity"/> is smaller than, equal to, or greater than the <see cref="Gu.Units.Voltage"/> object.
 /// </summary>
 /// <returns>
 /// A signed number indicating the relative quantitys of this instance and <paramref name="quantity"/>.
 ///
 ///                     Value
 ///
 ///                     Description
 ///
 ///                     A negative integer
 ///
 ///                     This instance is smaller than <paramref name="quantity"/>.
 ///
 ///                     Zero
 ///
 ///                     This instance is equal to <paramref name="quantity"/>.
 ///
 ///                     A positive integer
 ///
 ///                     This instance is larger than <paramref name="quantity"/>.
 ///
 /// </returns>
 /// <param name="quantity">An instance of <see cref="Gu.Units.Voltage"/> object to compare to this instance.</param>
 public int CompareTo(Voltage quantity)
 {
     return(this.volts.CompareTo(quantity.volts));
 }
コード例 #13
0
 /// <summary>
 /// Creates an instance of <see cref="Gu.Units.Voltage"/> from its string representation
 /// </summary>
 /// <param name="text">The string representation of the <see cref="Gu.Units.Voltage"/></param>
 /// <param name="styles">Specifies the <see cref="NumberStyles"/> to be used.</param>
 /// <param name="provider">Specifies the formatProvider to be used.</param>
 /// <param name="result">The parsed <see cref="Voltage"/></param>
 /// <returns>True if an instance of <see cref="Voltage"/> could be parsed from <paramref name="text"/></returns>
 public static bool TryParse(string text, NumberStyles styles, IFormatProvider provider, out Voltage result)
 {
     return(QuantityParser.TryParse <VoltageUnit, Voltage>(text, From, styles, provider, out result));
 }
コード例 #14
0
 /// <summary>
 /// Creates an instance of <see cref="Gu.Units.Voltage"/> from its string representation
 /// </summary>
 /// <param name="text">The string representation of the <see cref="Gu.Units.Voltage"/></param>
 /// <param name="styles">Specifies the <see cref="NumberStyles"/> to be used.</param>
 /// <param name="result">The parsed <see cref="Voltage"/></param>
 /// <returns>True if an instance of <see cref="Voltage"/> could be parsed from <paramref name="text"/></returns>
 public static bool TryParse(string text, NumberStyles styles, out Voltage result)
 {
     return(QuantityParser.TryParse <VoltageUnit, Voltage>(text, From, styles, CultureInfo.CurrentCulture, out result));
 }
コード例 #15
0
ファイル: Power.generated.cs プロジェクト: forki/Gu.Units
 /// <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="Voltage"/> that is the result from the division.</returns>
 public static Voltage operator /(Power left, Current right)
 {
     return(Voltage.FromVolts(left.watts / right.amperes));
 }
コード例 #16
0
 public static Voltage operator /(Energy left, ElectricCharge right)
 {
     return(Voltage.FromVolts(left.joules / right.coulombs));
 }