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

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

There is a newer version: 1.18.2
Show newest version
package gw.util.science
uses gw.util.Rational
uses DimensionlessConstants#pi
uses MetricScaleUnit#*

enum SolidAngleUnit implements IUnit {
  Steradian( 1, "Steradian", "sr" ),

  var _sr: Rational as Sterads
  var _name: String
  var _symbol: String

  static property get BASE() : SolidAngleUnit {
    return Steradian
  }

  private construct( sr: Rational, name: String, symbol: String ) {
    _sr = sr
    _name = name
    _symbol = symbol
  }

  override property get UnitName() : String {
    return _name
  }

   override property get UnitSymbol() : String {
    return _symbol
  }

  override function toBaseUnits( myUnits: Rational ) : Rational {
    return Sterads * myUnits
  }

  override function toNumber() : Rational {
    return Sterads
  }

  override function from( len: SolidAngle ) : Rational {
    return len.toBaseNumber() / Sterads
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy