Converts quantity from one unit to another unit @param quantity the quantity in the initial units @param from the initial units @param to the units after conversion @return the quantity in the units after conversion
(
final double quantity, final Unit from, final Unit to)
| 204 | * @return the quantity in the units after conversion |
| 205 | */ |
| 206 | public static double convert( |
| 207 | final double quantity, final Unit from, final Unit to) { |
| 208 | |
| 209 | return to.inSpecUnits(from.inBaseUnits(quantity)); |
| 210 | } |
| 211 | |
| 212 | private double inBaseUnits(final double inSpecUnits) { |
| 213 | return (ratio * inSpecUnits + a) * x; |
no test coverage detected