org.djunits.unit.scale

• All Implemented Interfaces:
Scale

extends Object
implements Scale
A Scale for transforming a slope as a grade, where 45 degrees is 1, and 90 degrees is infinite, to radians. The formula is: angle = atan(grade). The factor that is given, is the factor by which the value is multiplied to get a grade. When a scale is constructed for e.g. ratio as a percentage (100% instead of 1), the conversionFactor to apply is 0.01.

\$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) \$, @version \$Revision: 1147 \$, by \$Author: averbraeck \$, initial version Oct 11, 2015
Author:
Alexander Verbraeck, Peter Knoppers
• Constructor Summary

Constructors
Constructor and Description
Construct a Scale for transforming a slope as a grade, where 45 degrees is 1, and 90 degrees is infinite, to radians.
• Constructor Detail

Construct a Scale for transforming a slope as a grade, where 45 degrees is 1, and 90 degrees is infinite, to radians.
Parameters:
conversionFactorToGrade - the conversion factor by which this number has to be multiplied to convert it to the standard (e.g., SI) unit.
• Method Detail

• toStandardUnit

public final double toStandardUnit(double value)
Convert a value to an SI value using this scale.
Specified by:
toStandardUnit in interface Scale
Parameters:
value - the value to convert
Returns:
the corresponding SI value
• fromStandardUnit

public final double fromStandardUnit(double value)
Convert a value from an SI value to a value in the unit that uses this scale.
Specified by:
fromStandardUnit in interface Scale
Parameters:
value - the value to convert
Returns:
the corresponding value in the given unit