• All Implemented Interfaces:
`Serializable`, `Scale`

```public class GradeScale
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.

Author:
Alexander Verbraeck, Peter Knoppers
Serialized Form
• ### Constructor Summary

Constructors
Constructor Description
`GradeScale​(double conversionFactorToGrade)`
Construct a Scale for transforming a slope as a grade, where 45 degrees is 1, and 90 degrees is infinite, to radians.
• ### Method Summary

All Methods
Modifier and Type Method 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` `getConversionFactorToGrade()`
`int` `hashCode()`
`boolean` `isBaseSIScale()`
Return whether a scale is a 'standard' scale that would belong to an SI unit.
`double` `toStandardUnit​(double value)`
Convert a value to an SI value using this scale.
`String` `toString()`
• ### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
• ### Constructor Detail

`public GradeScale​(double conversionFactorToGrade)`
Construct a Scale for transforming a slope as a grade, where 45 degrees is 1, and 90 degrees is infinite, to radians.
Parameters:
`conversionFactorToGrade` - double; 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` - double; 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` - double; the value to convert
Returns:
the corresponding value in the given unit

`public final double getConversionFactorToGrade()`
Returns:
• #### isBaseSIScale

`public boolean isBaseSIScale()`
Return whether a scale is a 'standard' scale that would belong to an SI unit. For a linear scale, any scale with conversion factor 1 would be considered standard. For an offset scale, it would be considered standard if the offset is 0 and the conversion factor is 1.
Specified by:
`isBaseSIScale` in interface `Scale`
Returns:
boolean; whether the scale is a 'standard' scale that would belong to an SI unit.
• #### hashCode

`public int hashCode()`
Overrides:
`hashCode` in class `Object`
• #### equals

`public boolean equals​(Object obj)`
Overrides:
`equals` in class `Object`
• #### toString

`public String toString()`
Overrides:
`toString` in class `Object`