Package ucar.nc2.dt.ugrid.utils
Class AsaUnits
java.lang.Object
ucar.nc2.dt.ugrid.utils.AsaUnits
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration used in converting between different distance units.static enumEnumeration used in converting between different mass units.static enumEnumeration used in converting between different speed units. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
-
Constructor Details
-
AsaUnits
public AsaUnits()
-
-
Method Details
-
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
-