@LevelUpApi(contract=INTERNAL) public final class DistanceUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DistanceUtil.DistanceUnit
Common distance units.
|
Modifier and Type | Method and Description |
---|---|
static float |
convertDistance(float distanceInMeters,
DistanceUtil.DistanceUnit desiredUnit)
Converts a distance in meters to the desired unit.
|
static float |
roundDistance(float distance)
Rounds the distance to the upper 0.5.
|
public static float convertDistance(float distanceInMeters, DistanceUtil.DistanceUnit desiredUnit)
distanceInMeters
- the input distance, in meters.desiredUnit
- the unit to return.public static float roundDistance(float distance)
distance
- input distance.