Package ucar.nc2.dt.ugrid.utils
Class AsaUnits
- java.lang.Object
-
- ucar.nc2.dt.ugrid.utils.AsaUnits
-
public class AsaUnits extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAsaUnits.DistanceTypeEnumeration used in converting between different distance units.static classAsaUnits.MassTypeEnumeration used in converting between different mass units.static classAsaUnits.SpeedTypeEnumeration used in converting between different speed units.
-
Constructor Summary
Constructors Constructor Description AsaUnits()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleconvertDistance(AsaUnits.DistanceType fromUnits, AsaUnits.DistanceType toUnits, double distance)Converts the givendistancefrom the unitsfromUnitsto the units specified bytoUnitstatic double[]convertDistance(AsaUnits.DistanceType fromUnits, AsaUnits.DistanceType toUnits, double[] distance)Converts the givendistancearray from the unitsfromUnitsto the units specified bytoUnitstatic doubleconvertSpeed(AsaUnits.SpeedType fromUnits, AsaUnits.SpeedType toUnits, double speed)Converts the givenspeedfrom the unitsfromUnitsto the units specified bytoUnitstatic double[]convertSpeed(AsaUnits.SpeedType fromUnits, AsaUnits.SpeedType toUnits, double[] speed)Converts the givenspeedarray from the unitsfromUnitsto the units specified bytoUnit
-
-
-
Method Detail
-
convertSpeed
public static double convertSpeed(AsaUnits.SpeedType fromUnits, AsaUnits.SpeedType toUnits, double speed)
Converts the givenspeedfrom the unitsfromUnitsto the units specified bytoUnit- Parameters:
fromUnits- an enumeration specifying the unit type ofspeedtoUnits- an enumeration specifying the units to convertspeedtospeed- adoublevalue to convert to the given units- Returns:
- the number given by
speedconverted from one unit to another
-
convertSpeed
public static double[] convertSpeed(AsaUnits.SpeedType fromUnits, AsaUnits.SpeedType toUnits, double[] speed)
Converts the givenspeedarray from the unitsfromUnitsto the units specified bytoUnit- Parameters:
fromUnits- an enumeration specifying the unit type ofspeedtoUnits- an enumeration specifying the units to convertspeedtospeed- adouble[]of values to convert to the given units- Returns:
- the numbers given by
speedconverted from one unit to another
-
convertDistance
public static double convertDistance(AsaUnits.DistanceType fromUnits, AsaUnits.DistanceType toUnits, double distance)
Converts the givendistancefrom the unitsfromUnitsto the units specified bytoUnit- Parameters:
fromUnits- an enumeration specifying the unit type ofdistancetoUnits- an enumeration specifying the units to convertdistancetodistance- adoublevalue to convert to the given units- Returns:
- the number given by
distanceconverted from one unit to another
-
convertDistance
public static double[] convertDistance(AsaUnits.DistanceType fromUnits, AsaUnits.DistanceType toUnits, double[] distance)
Converts the givendistancearray from the unitsfromUnitsto the units specified bytoUnit- Parameters:
fromUnits- an enumeration specifying the unit type ofdistancetoUnits- an enumeration specifying the units to convertdistancetodistance- adouble[]value to convert to the given units- Returns:
- the numbers given by
distanceconverted from one unit to another
-
-