kaos.robots.util.gps
Class Degrees

java.lang.Object
  extended by kaos.robots.util.gps.Degrees
All Implemented Interfaces:
java.io.Serializable

public class Degrees
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  double _decDegrees
           
protected  double _decMinutes
           
protected  int _degrees
           
protected  java.lang.String _direction
           
protected  int _minutes
           
protected  double _seconds
           
protected  boolean isNegative
           
protected static char minChar
           
protected  java.text.NumberFormat N
           
protected static char secChar
           
 
Constructor Summary
Degrees()
           
Degrees(double degrees)
          Construct a postition from decimal degrees DDD.DDDDD to DDD MM" SS' Must use in conjunction with setDirectionString (String pos, String neg)
Degrees(double degrees, double minutes, java.lang.String bearing)
          Construct a postition from degrees decimalMinutes DDD mm.mmm to DDD MM" SS'
Degrees(java.lang.String direction, int degrees, int minutes, double seconds)
          Construct a postition from minutes/seconds.
 
Method Summary
protected  void convertToDecimalFormat(int degrees, int minutes, double seconds)
          A circle has 360 degrees, 60 minutes per degree, and 60 seconds per minute.
 double getDecimalDegrees()
          ddd.ddddd form
 double getDecimalMinutes()
          mm.mmmm Can make a call to getDegrees (DDD) and concat DDDmm.mmm for decimal minutes form.
 int getDegrees()
           
protected  boolean getDirection()
          Get Direction
 java.lang.String getDirectionString()
          Get Direction String
 int getMinutes()
           
 double getSeconds()
           
protected  void setDirection(java.lang.String dir)
          Set Direction and negative or positive value for this position NE is positive SW is negative
protected  void setDirectionString(java.lang.String pos, java.lang.String neg)
          Set Direction "N", "S", "E", "W"
 java.lang.String toString()
          Return Position as a string in DD MM SS.ss format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_degrees

protected int _degrees

_minutes

protected int _minutes

_seconds

protected double _seconds

_decMinutes

protected double _decMinutes

_decDegrees

protected double _decDegrees

_direction

protected java.lang.String _direction

isNegative

protected boolean isNegative

minChar

protected static final char minChar
See Also:
Constant Field Values

secChar

protected static final char secChar
See Also:
Constant Field Values

N

protected java.text.NumberFormat N
Constructor Detail

Degrees

public Degrees()

Degrees

public Degrees(java.lang.String direction,
               int degrees,
               int minutes,
               double seconds)
Construct a postition from minutes/seconds. Direction is N, S, E, W.

Parameters:
minutes -
seconds -

Degrees

public Degrees(double degrees)
Construct a postition from decimal degrees DDD.DDDDD to DDD MM" SS' Must use in conjunction with setDirectionString (String pos, String neg)

Parameters:
degrees - -- degree decimal form

Degrees

public Degrees(double degrees,
               double minutes,
               java.lang.String bearing)
Construct a postition from degrees decimalMinutes DDD mm.mmm to DDD MM" SS'

Parameters:
degrees - -- degree decimal form
Method Detail

getDirectionString

public java.lang.String getDirectionString()
Get Direction String

Returns:
direction string (N/S/E/W)

getDegrees

public int getDegrees()

getMinutes

public int getMinutes()

getSeconds

public double getSeconds()

getDecimalMinutes

public double getDecimalMinutes()
mm.mmmm Can make a call to getDegrees (DDD) and concat DDDmm.mmm for decimal minutes form.


getDecimalDegrees

public double getDecimalDegrees()
ddd.ddddd form


setDirectionString

protected void setDirectionString(java.lang.String pos,
                                  java.lang.String neg)
Set Direction "N", "S", "E", "W"


convertToDecimalFormat

protected void convertToDecimalFormat(int degrees,
                                      int minutes,
                                      double seconds)
A circle has 360 degrees, 60 minutes per degree, and 60 seconds per minute. There are 3,600 seconds per degree.


getDirection

protected boolean getDirection()
Get Direction

Returns:
true if value should be negative (SW) false if value should be positive (NE)

setDirection

protected void setDirection(java.lang.String dir)
Set Direction and negative or positive value for this position NE is positive SW is negative


toString

public java.lang.String toString()
Return Position as a string in DD MM SS.ss format

Overrides:
toString in class java.lang.Object