Package edu.wpi.first.math.util
Class Units
java.lang.Object
edu.wpi.first.math.util.Units
public final class Units extends Object
Utility class that converts between commonly used units in FRC.
-
Method Summary
Modifier and Type Method Description static double
degreesToRadians(double degrees)
Converts given degrees to radians.static double
degreesToRotations(double degrees)
Converts given degrees to rotations.static double
feetToMeters(double feet)
Converts given feet to meters.static double
inchesToMeters(double inches)
Converts given inches to meters.static double
kilogramsToLbs(double kilograms)
Converts kilograms into lbs (pound-mass).static double
lbsToKilograms(double lbs)
Converts lbs (pound-mass) into kilograms.static double
metersToFeet(double meters)
Converts given meters to feet.static double
metersToInches(double meters)
Converts given meters to inches.static double
millisecondsToSeconds(double milliseconds)
Converts given milliseconds to seconds.static double
radiansPerSecondToRotationsPerMinute(double radiansPerSecond)
Converts radians per second to rotations per minute.static double
radiansToDegrees(double radians)
Converts given radians to degrees.static double
radiansToRotations(double radians)
Converts given radians to rotations.static double
rotationsPerMinuteToRadiansPerSecond(double rpm)
Converts rotations per minute to radians per second.static double
rotationsToDegrees(double rotations)
Converts given rotations to degrees.static double
rotationsToRadians(double rotations)
Converts given rotations to radians.static double
secondsToMilliseconds(double seconds)
Converts given seconds to milliseconds.
-
Method Details
-
metersToFeet
Converts given meters to feet.- Parameters:
meters
- The meters to convert to feet.- Returns:
- Feet converted from meters.
-
feetToMeters
Converts given feet to meters.- Parameters:
feet
- The feet to convert to meters.- Returns:
- Meters converted from feet.
-
metersToInches
Converts given meters to inches.- Parameters:
meters
- The meters to convert to inches.- Returns:
- Inches converted from meters.
-
inchesToMeters
Converts given inches to meters.- Parameters:
inches
- The inches to convert to meters.- Returns:
- Meters converted from inches.
-
degreesToRadians
Converts given degrees to radians.- Parameters:
degrees
- The degrees to convert to radians.- Returns:
- Radians converted from degrees.
-
radiansToDegrees
Converts given radians to degrees.- Parameters:
radians
- The radians to convert to degrees.- Returns:
- Degrees converted from radians.
-
radiansToRotations
Converts given radians to rotations.- Parameters:
radians
- The radians to convert.- Returns:
- rotations Converted from radians.
-
degreesToRotations
Converts given degrees to rotations.- Parameters:
degrees
- The degrees to convert.- Returns:
- rotations Converted from degrees.
-
rotationsToDegrees
Converts given rotations to degrees.- Parameters:
rotations
- The rotations to convert.- Returns:
- degrees Converted from rotations.
-
rotationsToRadians
Converts given rotations to radians.- Parameters:
rotations
- The rotations to convert.- Returns:
- radians Converted from rotations.
-
rotationsPerMinuteToRadiansPerSecond
Converts rotations per minute to radians per second.- Parameters:
rpm
- The rotations per minute to convert to radians per second.- Returns:
- Radians per second converted from rotations per minute.
-
radiansPerSecondToRotationsPerMinute
Converts radians per second to rotations per minute.- Parameters:
radiansPerSecond
- The radians per second to convert to from rotations per minute.- Returns:
- Rotations per minute converted from radians per second.
-
millisecondsToSeconds
Converts given milliseconds to seconds.- Parameters:
milliseconds
- The milliseconds to convert to seconds.- Returns:
- Seconds converted from milliseconds.
-
secondsToMilliseconds
Converts given seconds to milliseconds.- Parameters:
seconds
- The seconds to convert to milliseconds.- Returns:
- Milliseconds converted from seconds.
-
kilogramsToLbs
Converts kilograms into lbs (pound-mass).- Parameters:
kilograms
- The kilograms to convert to lbs (pound-mass).- Returns:
- Lbs (pound-mass) converted from kilograms.
-
lbsToKilograms
Converts lbs (pound-mass) into kilograms.- Parameters:
lbs
- The lbs (pound-mass) to convert to kilograms.- Returns:
- Kilograms converted from lbs (pound-mass).
-