All Packages Class Hierarchy This Package Previous Next Index
Class EDU.gatech.cc.is.util.Units
java.lang.Object
|
+----EDU.gatech.cc.is.util.Units
- public class Units
- extends Object
Routines for units conversion.
Copyright
(c)1997, 1998 Tucker Balch
- Version:
- $Revision: 1.4 $
- Author:
- Tucker Balch
-
HUGE
- A very large number
-
PI2
- Handy to have 2 PI around.
-
Units()
-
-
BestTurnDeg(double, double)
- Compute the best direction and angle to turn from the start
angle to the finish angle in degrees.
-
BestTurnRad(double, double)
- Compute the best direction and angle to turn from the start
angle to the finish angle in radians.
-
ClipDeg(double)
- Limit the angle to between 0 and 359.9999.
-
ClipRad(double)
- Limit the angle to between 0 and 2 PI.
-
Deg10ToRad(int)
- Convert 10ths of degrees to radians.
-
DegToRad(double)
- Convert degrees to radians.
-
DegToRad(int)
- Convert degrees to radians.
-
Inch10ToMeter(int)
- Convert 10ths of inches to meters.
-
InchToMeter(double)
- Convert inches to meters.
-
InchToMeter(int)
- Convert inches to meters.
-
main(String[])
- Test the units functions.
-
MeterToInch(double)
- Convert meters to inches.
-
MeterToInch10(double)
- Convert meters to 10ths of inches.
-
RadToDeg(double)
- Convert radians to degrees.
-
RadToDeg10(double)
- Convert radians to 10ths of degrees.
-
readDouble(StreamTokenizer)
- read a double from a stream.
PI2
public static final double PI2
- Handy to have 2 PI around.
HUGE
public static final double HUGE
- A very large number
Units
public Units()
DegToRad
public static double DegToRad(double deg)
- Convert degrees to radians.
- Parameters:
- deg - double, degrees.
- Returns:
- radians.
DegToRad
public static double DegToRad(int deg)
- Convert degrees to radians.
- Parameters:
- deg - int, degrees.
- Returns:
- radians.
Deg10ToRad
public static double Deg10ToRad(int deg10)
- Convert 10ths of degrees to radians.
- Parameters:
- deg10 - int, 10ths of degrees.
- Returns:
- radians.
RadToDeg
public static double RadToDeg(double rad)
- Convert radians to degrees.
- Parameters:
- rad - double, radians.
- Returns:
- degrees.
RadToDeg10
public static int RadToDeg10(double rad)
- Convert radians to 10ths of degrees.
- Parameters:
- rad - double, radians.
- Returns:
- 10ths of degrees.
InchToMeter
public static double InchToMeter(int inch)
- Convert inches to meters.
- Parameters:
- inch - int, inches.
- Returns:
- meters.
InchToMeter
public static double InchToMeter(double inch)
- Convert inches to meters.
- Parameters:
- inch - double, inches.
- Returns:
- meters.
Inch10ToMeter
public static double Inch10ToMeter(int inch10)
- Convert 10ths of inches to meters.
- Parameters:
- inch - int, inches.
- Returns:
- 10ths of meters.
MeterToInch10
public static int MeterToInch10(double meter)
- Convert meters to 10ths of inches.
- Parameters:
- meter - double, meters.
- Returns:
- inches.
MeterToInch
public static double MeterToInch(double meter)
- Convert meters to inches.
- Parameters:
- meter - double, meters.
- Returns:
- inches.
ClipRad
public static double ClipRad(double rad)
- Limit the angle to between 0 and 2 PI.
- Parameters:
- rad - double, angle in radians to be clipped.
- Returns:
- the clipped angle.
ClipDeg
public static double ClipDeg(double deg)
- Limit the angle to between 0 and 359.9999.
- Parameters:
- deg - double, angle in degrees to be clipped.
- Returns:
- the clipped angle.
BestTurnDeg
public static double BestTurnDeg(double start,
double finish)
- Compute the best direction and angle to turn from the start
angle to the finish angle in degrees.
- Parameters:
- start - The starting angle.
- finish - The desired angle.
- Returns:
- the required turn.
readDouble
public static double readDouble(StreamTokenizer in) throws Exception
- read a double from a stream. Assumes you have just read the
token.
- Parameters:
- in - StreamTokenizer, the stream to read from.
- Returns:
- the double.
- Throws: Exception
- if there is no number there.
BestTurnRad
public static double BestTurnRad(double start,
double finish)
- Compute the best direction and angle to turn from the start
angle to the finish angle in radians.
- Parameters:
- start - The starting angle.
- finish - The desired angle.
- Returns:
- s The required turn.
main
public static void main(String args[])
- Test the units functions.
All Packages Class Hierarchy This Package Previous Next Index