All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gw.util.science.Potential.gs Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
package gw.util.science

uses gw.util.Rational
uses java.math.RoundingMode
uses java.math.MathContext

final class Potential extends AbstractMeasure {
  construct( value : Rational, unit: PotentialUnit, displayUnit: PotentialUnit ) {
    super( value, unit, displayUnit, PotentialUnit.BASE )
  }
  construct( value : Rational, unit: PotentialUnit ) {
    this( value, unit, unit )
  }

  function multiply( current: Current ) : Power {
    return new Power( toBaseNumber() * current.toBaseNumber(), PowerUnit.BASE, Unit.PowerUnit )
  }

  function divide( i: Current ) : Resistance {
    return new Resistance( toBaseNumber() / i.toBaseNumber(), ResistanceUnit.BASE, ResistanceUnit.get( Unit, i.Unit ) )
  }
  function divide( r: Resistance ) : Current {
    return new Current( toBaseNumber() / r.toBaseNumber(), CurrentUnit.BASE, r.Unit.CurrentUnit )
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy