EDU.gatech.cc.is.util Class Units

java.lang.Object
|
+--EDU.gatech.cc.is.util.Units

public class Units
extends java.lang.Object

Routines for units conversion.

Copyright (c)2000 Tucker Balch

 Field Summary static double HUGE           A very large number static double PI2           Handy to have 2 PI around.

 Constructor Summary Units()

 Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 Field Detail

PI2

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

HUGE

public static final double HUGE
A very large number
 Constructor Detail

Units

public Units()
 Method Detail

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

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

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

Convert radians to degrees.
Parameters:
Returns:
degrees.

Convert radians to 10ths of degrees.
Parameters:
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.

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.

public static double readDouble(java.io.StreamTokenizer in)
throws java.lang.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:
java.lang.Exception - if there is no number there.
{"ft_lang_label":"__label__en","ft_lang_prob":0.5474346,"math_prob":0.41891629,"size":3353,"snap":"2019-43-2019-47","text_gpt3_token_len":822,"char_repetition_ratio":0.23260675,"word_repetition_ratio":0.27593362,"special_character_ratio":0.23382045,"punctuation_ratio":0.14982578,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9787743,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-16T21:12:06Z\",\"WARC-Record-ID\":\"<urn:uuid:90e33ae3-f92a-4e00-b447-5f4404276296>\",\"Content-Length\":\"21107\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f4f98289-f460-4d59-9733-2e4bea0fdf10>\",\"WARC-Concurrent-To\":\"<urn:uuid:c50040b4-411d-4a7c-b521-af49eca45656>\",\"WARC-IP-Address\":\"128.2.42.95\",\"WARC-Target-URI\":\"http://www.cs.cmu.edu/~trb/TeamBots/Docs/EDU/gatech/cc/is/util/Units.html\",\"WARC-Payload-Digest\":\"sha1:SASDK5FHIMS47Q4NTAEGGRUYAPOLBMNW\",\"WARC-Block-Digest\":\"sha1:AA3PRVJT6QVTXWHPV2637KXMHBRSY7ME\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570986669546.24_warc_CC-MAIN-20191016190431-20191016213931-00464.warc.gz\"}"}