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

Variable Index

 o HUGE
A very large number
 o PI2
Handy to have 2 PI around.

Constructor Index

 o Units()

Method Index

 o BestTurnDeg(double, double)
Compute the best direction and angle to turn from the start angle to the finish angle in degrees.
 o BestTurnRad(double, double)
Compute the best direction and angle to turn from the start angle to the finish angle in radians.
 o ClipDeg(double)
Limit the angle to between 0 and 359.9999.
 o ClipRad(double)
Limit the angle to between 0 and 2 PI.
 o Deg10ToRad(int)
Convert 10ths of degrees to radians.
 o DegToRad(double)
Convert degrees to radians.
 o DegToRad(int)
Convert degrees to radians.
 o Inch10ToMeter(int)
Convert 10ths of inches to meters.
 o InchToMeter(double)
Convert inches to meters.
 o InchToMeter(int)
Convert inches to meters.
 o main(String[])
Test the units functions.
 o MeterToInch(double)
Convert meters to inches.
 o MeterToInch10(double)
Convert meters to 10ths of inches.
 o RadToDeg(double)
Convert radians to degrees.
 o RadToDeg10(double)
Convert radians to 10ths of degrees.
 o readDouble(StreamTokenizer)
read a double from a stream.

Variables

 o PI2
 public static final double PI2
Handy to have 2 PI around.

 o HUGE
 public static final double HUGE
A very large number

Constructors

 o Units
 public Units()

Methods

 o DegToRad
 public static double DegToRad(double deg)
Convert degrees to radians.

Parameters:
deg - double, degrees.
Returns:
radians.
 o DegToRad
 public static double DegToRad(int deg)
Convert degrees to radians.

Parameters:
deg - int, degrees.
Returns:
radians.
 o Deg10ToRad
 public static double Deg10ToRad(int deg10)
Convert 10ths of degrees to radians.

Parameters:
deg10 - int, 10ths of degrees.
Returns:
radians.
 o RadToDeg
 public static double RadToDeg(double rad)
Convert radians to degrees.

Parameters:
rad - double, radians.
Returns:
degrees.
 o RadToDeg10
 public static int RadToDeg10(double rad)
Convert radians to 10ths of degrees.

Parameters:
rad - double, radians.
Returns:
10ths of degrees.
 o InchToMeter
 public static double InchToMeter(int inch)
Convert inches to meters.

Parameters:
inch - int, inches.
Returns:
meters.
 o InchToMeter
 public static double InchToMeter(double inch)
Convert inches to meters.

Parameters:
inch - double, inches.
Returns:
meters.
 o Inch10ToMeter
 public static double Inch10ToMeter(int inch10)
Convert 10ths of inches to meters.

Parameters:
inch - int, inches.
Returns:
10ths of meters.
 o MeterToInch10
 public static int MeterToInch10(double meter)
Convert meters to 10ths of inches.

Parameters:
meter - double, meters.
Returns:
inches.
 o MeterToInch
 public static double MeterToInch(double meter)
Convert meters to inches.

Parameters:
meter - double, meters.
Returns:
inches.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o main
 public static void main(String args[])
Test the units functions.


All Packages  Class Hierarchy  This Package  Previous  Next  Index