public class LinearScale extends Object implements Scale
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
LinearScale(double conversionFactorToStandardUnit)
Construct a Scale for linear transformations.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
double |
fromStandardUnit(double value)
Convert a value from an SI value to a value in the unit that uses this scale.
|
double |
getConversionFactorToStandardUnit() |
int |
hashCode() |
boolean |
isBaseSIScale()
Return whether this is a base (SI) scale.
|
double |
toStandardUnit(double value)
Convert a value to an SI value using this scale.
|
public LinearScale(double conversionFactorToStandardUnit)
conversionFactorToStandardUnit
- double; the conversion factor by which this number has to be multiplied to convert
it to the standard (e.g., SI) unit.public double toStandardUnit(double value)
toStandardUnit
in interface Scale
value
- double; the value to convertpublic double fromStandardUnit(double value)
fromStandardUnit
in interface Scale
value
- double; the value to convertpublic final double getConversionFactorToStandardUnit()
public boolean isBaseSIScale()
isBaseSIScale
in interface Scale
Copyright © 2015–2019 Delft University of Technology. All rights reserved.