|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.v3x.geometry.projections.CircularCoord
public class CircularCoord
High-precision representation of a circular coordinate such as latitude or longitude.
Degrees are represented as signed shorts; coordinates in the western or southern hemisphere are negative while those in the eastern or northern hemisphere are positive.
Minutes and seconds are represented as unsigned bytes, and fractions of a second by a single unsigned int.
This should provide a ridiculous amount of precision in only 8 bytes, the size of a double - something like a precision of a hundred millionth of a foot, in case someone really cares.
| Constructor Summary | |
|---|---|
CircularCoord(int degrees,
double decMinutes)
|
|
CircularCoord(int degrees,
int minutes,
double decSeconds)
|
|
CircularCoord(int degrees,
int minutes,
int seconds,
int fracts)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
CircularCoord |
copy()
|
CircularCoord |
distanceFrom(CircularCoord nother)
|
static short |
fixDegrees(int degrees)
Fixes degrees to correct range of -180 to +180. |
static byte |
fixMinutes(int minutes)
Fixes minutes to correct range of 0 to 59. |
static byte |
fixSeconds(int seconds)
Just for symmetry's sake |
double |
getDecimalDegrees()
|
double |
getDecimalMinutes()
|
double |
getDecimalSeconds()
|
short |
getDegrees()
|
int |
getFracts()
|
byte |
getMinutes()
|
byte |
getSeconds()
|
static long |
packCoord(CircularCoord coord)
Packs a coordinate into 8 bytes (represented as a long). |
void |
setDegrees(short argDegrees)
|
void |
setFracts(int argFracts)
|
void |
setMinutes(byte argMinutes)
|
void |
setSeconds(byte argSeconds)
|
java.lang.String |
toString()
|
static CircularCoord |
unpackCoord(long packed)
Unpacks coordinates from 8-byte long representation. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CircularCoord(int degrees,
int minutes,
int seconds,
int fracts)
public CircularCoord(int degrees,
double decMinutes)
public CircularCoord(int degrees,
int minutes,
double decSeconds)
| Method Detail |
|---|
public static long packCoord(CircularCoord coord)
public static CircularCoord unpackCoord(long packed)
public static short fixDegrees(int degrees)
public static byte fixMinutes(int minutes)
public static byte fixSeconds(int seconds)
public CircularCoord distanceFrom(CircularCoord nother)
public java.lang.String toString()
toString in class java.lang.Objectpublic CircularCoord copy()
public java.lang.Object clone()
clone in class java.lang.Objectpublic final double getDecimalDegrees()
public final double getDecimalMinutes()
public final double getDecimalSeconds()
public short getDegrees()
public void setDegrees(short argDegrees)
public byte getMinutes()
public void setMinutes(byte argMinutes)
public byte getSeconds()
public void setSeconds(byte argSeconds)
public int getFracts()
public void setFracts(int argFracts)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||