|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Utils.Units
Routines for units conversion.
This class comes from Tucker Balch: (c)1997, 1998 Tucker Balch
Field Summary | |
---|---|
static double |
HUGE
A very large number |
static double |
PI
Handy to have 2 PI around. |
static double |
PI2
|
Constructor Summary | |
---|---|
Units()
|
Method Summary | |
---|---|
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. |
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. |
static double |
clipDeg(double deg)
Limit the angle to between 0 and 359.9999. |
static double |
clipRad(double rad)
Limit the angle to between 0 and 2 PI. |
static double |
deg10ToRad(int deg10)
Convert 10ths of degrees to radians. |
static double |
degToRad(double deg)
Convert degrees to radians. |
static double |
degToRad(int deg)
Convert degrees to radians. |
static double |
inch10ToMeter(int inch10)
Convert 10ths of inches to meters. |
static double |
inchToMeter(double inch)
Convert inches to meters. |
static double |
inchToMeter(int inch)
Convert inches to meters. |
static void |
main(java.lang.String[] args)
Test the units functions. |
static double |
meterToInch(double meter)
Convert meters to inches. |
static int |
meterToInch10(double meter)
Convert meters to 10ths of inches. |
static double |
NormalizePI(double t)
Normalize an angle into the range [0,2*PI] |
static double |
NormalizeZero(double t)
Normalize an angle into the range [-PI,PI] |
static double |
radToDeg(double rad)
Convert radians to degrees. |
static int |
radToDeg10(double rad)
Convert radians to 10ths of degrees. |
static double |
readDouble(java.io.StreamTokenizer in)
read a double from a stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double PI
public static final double PI2
public static final double HUGE
Constructor Detail |
public Units()
Method Detail |
public static double NormalizePI(double t)
public static double NormalizeZero(double t)
public static double degToRad(double deg)
deg
- double, degrees.
public static double degToRad(int deg)
deg
- int, degrees.
public static double deg10ToRad(int deg10)
deg10
- int, 10ths of degrees.
public static double radToDeg(double rad)
rad
- double, radians.
public static int radToDeg10(double rad)
rad
- double, radians.
public static double inchToMeter(int inch)
inch
- int, inches.
public static double inchToMeter(double inch)
inch
- double, inches.
public static double inch10ToMeter(int inch10)
public static int meterToInch10(double meter)
meter
- double, meters.
public static double meterToInch(double meter)
meter
- double, meters.
public static double clipRad(double rad)
rad
- double, angle in radians to be clipped.
public static double clipDeg(double deg)
deg
- double, angle in degrees to be clipped.
public static double bestTurnDeg(double start, double finish)
start
- The starting angle.finish
- The desired angle.
public static double readDouble(java.io.StreamTokenizer in) throws java.lang.Exception
in
- StreamTokenizer, the stream to read from.
java.lang.Exception
- if there is no number there.public static double bestTurnRad(double start, double finish)
start
- The starting angle.finish
- The desired angle.
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |