<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_24) on Mon May 16 13:33:33 BST 2011 -->
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
Coordinates (leJOS NXJ API documentation)
</TITLE>

<META NAME="date" CONTENT="2011-05-16">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Coordinates (leJOS NXJ API documentation)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/location/AddressInfo.html" title="class in javax.microedition.location"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/location/Criteria.html" title="class in javax.microedition.location"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?javax/microedition/location/Coordinates.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Coordinates.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.location</FONT>
<BR>
Class Coordinates</H2>
<PRE>
<A HREF="../../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
  <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>javax.microedition.location.Coordinates</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../javax/microedition/location/QualifiedCoordinates.html" title="class in javax.microedition.location">QualifiedCoordinates</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>Coordinates</B><DT>extends <A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A></DL>
</PRE>

<P>
This class has been designed to manage coordinates 
 using JSR-179 Location API
 http://www.jcp.org/en/jsr/detail?id=179
<P>

<P>
<DL>
<DT><B>Author:</B></DT>
  <DD>Juan Antonio Brenha Moral (calculateDistanceAndAzimuth by Charles Manning)</DD>
</DL>
<HR>

<P>
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#DD_MM">DD_MM</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Identifier for string coordinate representation Degrees, Minutes, decimal fractions of a minute
 See Also:Constant Field Values</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#DD_MM_SS">DD_MM_SS</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Identifier for string coordinate representation Degrees, Minutes, Seconds and decimal fractions of a second
 See Also:Constant Field Values</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#Coordinates(double, double)">Coordinates</A></B>(double&nbsp;latitude,
            double&nbsp;longitude)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#Coordinates(double, double, double)">Coordinates</A></B>(double&nbsp;latitude,
            double&nbsp;longitude,
            double&nbsp;altitude)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a Coordinate object with 3 parameters:
 latitude, longitude and altitude</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#azimuthTo(javax.microedition.location.Coordinates)">azimuthTo</A></B>(<A HREF="../../../javax/microedition/location/Coordinates.html" title="class in javax.microedition.location">Coordinates</A>&nbsp;to)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the azimuth between the two points according to 
 the ellipsoid model of WGS84.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#convert(double, int)">convert</A></B>(double&nbsp;coordinate,
        int&nbsp;outputType)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UNTESTED as of April 7, 2009 - BB
 /

        /**
 Converts a double representation of a coordinate with decimal degrees into a string
 representation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#convert(java.lang.String)">convert</A></B>(<A HREF="../../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;coordinate)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts a String representation of a coordinate into the double representation as
 used in this API.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#distance(javax.microedition.location.Coordinates)">distance</A></B>(<A HREF="../../../javax/microedition/location/Coordinates.html" title="class in javax.microedition.location">Coordinates</A>&nbsp;to)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the geodetic distance between the two points according 
 to the ellipsoid model of WGS84.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#getAltitude()">getAltitude</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Altitude above mean sea level.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#getLatitude()">getLatitude</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get latitude</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#getLongitude()">getLongitude</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get Longitude</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#setAltitude(double)">setAltitude</A></B>(double&nbsp;altitude)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#setLatitude(double)">setLatitude</A></B>(double&nbsp;latitude)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/location/Coordinates.html#setLongitude(double)">setLongitude</A></B>(double&nbsp;longitude)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="DD_MM"><!-- --></A><H3>
DD_MM</H3>
<PRE>
public static final int <B>DD_MM</B></PRE>
<DL>
<DD>Identifier for string coordinate representation Degrees, Minutes, decimal fractions of a minute
 See Also:Constant Field Values
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.location.Coordinates.DD_MM">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="DD_MM_SS"><!-- --></A><H3>
DD_MM_SS</H3>
<PRE>
public static final int <B>DD_MM_SS</B></PRE>
<DL>
<DD>Identifier for string coordinate representation Degrees, Minutes, Seconds and decimal fractions of a second
 See Also:Constant Field Values
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.location.Coordinates.DD_MM_SS">Constant Field Values</A></DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="Coordinates(double, double, double)"><!-- --></A><H3>
Coordinates</H3>
<PRE>
public <B>Coordinates</B>(double&nbsp;latitude,
                   double&nbsp;longitude,
                   double&nbsp;altitude)</PRE>
<DL>
<DD>Create a Coordinate object with 3 parameters:
 latitude, longitude and altitude
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>latitude</CODE> - <DD><CODE>longitude</CODE> - <DD><CODE>altitude</CODE> - </DL>
</DL>
<HR>

<A NAME="Coordinates(double, double)"><!-- --></A><H3>
Coordinates</H3>
<PRE>
public <B>Coordinates</B>(double&nbsp;latitude,
                   double&nbsp;longitude)</PRE>
<DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getLatitude()"><!-- --></A><H3>
getLatitude</H3>
<PRE>
public double <B>getLatitude</B>()</PRE>
<DL>
<DD>Get latitude
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the latitude</DL>
</DD>
</DL>
<HR>

<A NAME="setLatitude(double)"><!-- --></A><H3>
setLatitude</H3>
<PRE>
public void <B>setLatitude</B>(double&nbsp;latitude)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="setLongitude(double)"><!-- --></A><H3>
setLongitude</H3>
<PRE>
public void <B>setLongitude</B>(double&nbsp;longitude)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getLongitude()"><!-- --></A><H3>
getLongitude</H3>
<PRE>
public double <B>getLongitude</B>()</PRE>
<DL>
<DD>Get Longitude
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the longitude</DL>
</DD>
</DL>
<HR>

<A NAME="setAltitude(double)"><!-- --></A><H3>
setAltitude</H3>
<PRE>
public void <B>setAltitude</B>(double&nbsp;altitude)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getAltitude()"><!-- --></A><H3>
getAltitude</H3>
<PRE>
public double <B>getAltitude</B>()</PRE>
<DL>
<DD>Altitude above mean sea level.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the altitude</DL>
</DD>
</DL>
<HR>

<A NAME="azimuthTo(javax.microedition.location.Coordinates)"><!-- --></A><H3>
azimuthTo</H3>
<PRE>
public double <B>azimuthTo</B>(<A HREF="../../../javax/microedition/location/Coordinates.html" title="class in javax.microedition.location">Coordinates</A>&nbsp;to)</PRE>
<DL>
<DD>Calculates the azimuth between the two points according to 
 the ellipsoid model of WGS84. The azimuth is relative to true north. 
 The Coordinates object on which this method is called is considered 
 the origin for the calculation and the Coordinates object passed 
 as a parameter is the destination which the azimuth is calculated to. 
 When the origin is the North pole and the destination 
 is not the North pole, this method returns 180.0. 
 When the origin is the South pole and the destination is not 
 the South pole, this method returns 0.0. If the origin is equal 
 to the destination, this method returns 0.0. 
 The implementation shall calculate the result as exactly as it can. 
 However, it is required that the result is within 1 degree of the correct result.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="convert(double, int)"><!-- --></A><H3>
convert</H3>
<PRE>
public static <A HREF="../../../java/lang/String.html" title="class in java.lang">String</A> <B>convert</B>(double&nbsp;coordinate,
                             int&nbsp;outputType)
                      throws <A HREF="../../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></PRE>
<DL>
<DD>UNTESTED as of April 7, 2009 - BB
 /

        /**
 Converts a double representation of a coordinate with decimal degrees into a string
 representation. There are string syntaxes supported are the same as for the
 #convert(String) method. The implementation shall provide as many significant
 digits for the decimal fractions as are allowed by the string syntax definition.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>coordinate</CODE> - a double representation of a coordinate<DD><CODE>outputType</CODE> - identifier of the type of the string representation wanted for output
            The constant <A HREF="../../../javax/microedition/location/Coordinates.html#DD_MM_SS"><CODE>DD_MM_SS</CODE></A> identifies the syntax 1 and the constant
            <A HREF="../../../javax/microedition/location/Coordinates.html#DD_MM"><CODE>DD_MM</CODE></A> identifies the syntax 2.
<DT><B>Returns:</B><DD>a string representation of the coordinate in a representation indicated by
         the parameter
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - if the outputType is not one of the two constant values defined in this
             class or if the coordinate value is not within the range [-180.0,
             180.0) or is Double.NaN<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/location/Coordinates.html#convert(java.lang.String)"><CODE>convert(String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="convert(java.lang.String)"><!-- --></A><H3>
convert</H3>
<PRE>
public static double <B>convert</B>(<A HREF="../../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;coordinate)
                      throws <A HREF="../../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A>,
                             <A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></PRE>
<DL>
<DD>Converts a String representation of a coordinate into the double representation as
 used in this API. There are two string syntaxes supported:
 <p>
 1. Degrees, minutes, seconds and decimal fractions of seconds. This is expressed as
 a string complying with the following BNF definition where the degrees are within
 the range [-179, 179] and the minutes and seconds are within the range [0, 59], or
 the degrees is -180 and the minutes, seconds and decimal fractions are 0:
 <p>
 coordinate = degrees &quot;:&quot; minutes &quot;:&quot; seconds &quot;.&quot;
 decimalfrac | degrees &quot;:&quot; minutes &quot;:&quot; seconds | degrees
 &quot;:&quot; minutes<br />
 degrees = degreedigits | &quot;-&quot; degreedigits<br />
 degreedigits = digit | nonzerodigit digit | &quot;1&quot; digit digit<br />
 minutes = minsecfirstdigit digit<br />
 seconds = minsecfirstdigit digit<br />
 decimalfrac = 1*3digit <br />
 digit = &quot;0&quot; | &quot;1&quot; | &quot;2&quot; | &quot;3&quot; |
 &quot;4&quot; | &quot;5&quot; | &quot;6&quot; | &quot;7&quot; | &quot;8&quot; |
 &quot;9&quot;<br />
 nonzerodigit = &quot;1&quot; | &quot;2&quot; | &quot;3&quot; | &quot;4&quot; |
 &quot;5&quot; | &quot;6&quot; | &quot;7&quot; | &quot;8&quot; | &quot;9&quot;<br />
 minsecfirstdigit = &quot;0&quot; | &quot;1&quot; | &quot;2&quot; | &quot;3&quot; |
 &quot;4&quot; | &quot;5&quot;<br />
 <p>
 2. Degrees, minutes and decimal fractions of minutes. This is expressed as a string
 complying with the following BNF definition where the degrees are within the range
 [-179, 179] and the minutes are within the range [0, 59], or the degrees is -180
 and the minutes and decimal fractions are 0:
 <p>
 coordinate = degrees &quot;:&quot; minutes &quot;.&quot; decimalfrac | degrees
 &quot;:&quot; minutes<br/> degrees = degreedigits | &quot;-&quot; degreedigits<br/>
 degreedigits = digit | nonzerodigit digit | &quot;1&quot; digit digit<br/> minutes =
 minsecfirstdigit digit<br/> decimalfrac = 1*5digit<br/> digit = &quot;0&quot; |
 &quot;1&quot; | &quot;2&quot; | &quot;3&quot; | &quot;4&quot; | &quot;5&quot; |
 &quot;6&quot; | &quot;7&quot; | &quot;8&quot; | &quot;9&quot;<br/> nonzerodigit =
 &quot;1&quot; | &quot;2&quot; | &quot;3&quot; | &quot;4&quot; | &quot;5&quot; |
 &quot;6&quot; | &quot;7&quot; | &quot;8&quot; | &quot;9&quot;<br/>
 minsecfirstdigit = &quot;0&quot; | &quot;1&quot; | &quot;2&quot; | &quot;3&quot; |
 &quot;4&quot; | &quot;5&quot;
 <p>
 For example, for the double value of the coordinate 61.51d, the corresponding
 syntax 1 string is "61:30:36" and the corresponding syntax 2 string is "61:30.6".
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>coordinate</CODE> - a String in either of the two representation specified above
<DT><B>Returns:</B><DD>a double value with decimal degrees that matches the string representation
         given as the parameter
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - if the coordinate input parameter does not comply with the defined
             syntax for the specified types
<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if the coordinate string is null convert</DL>
</DD>
</DL>
<HR>

<A NAME="distance(javax.microedition.location.Coordinates)"><!-- --></A><H3>
distance</H3>
<PRE>
public double <B>distance</B>(<A HREF="../../../javax/microedition/location/Coordinates.html" title="class in javax.microedition.location">Coordinates</A>&nbsp;to)</PRE>
<DL>
<DD>Calculates the geodetic distance between the two points according 
 to the ellipsoid model of WGS84. Altitude is neglected from calculations.
 
 The implementation shall calculate this as exactly as it can. 
 However, it is required that the result is within 0.36% of 
 the correct result.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>to</CODE> - the point to calculate the geodetic to
<DT><B>Returns:</B><DD>the distance</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/location/AddressInfo.html" title="class in javax.microedition.location"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/location/Criteria.html" title="class in javax.microedition.location"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?javax/microedition/location/Coordinates.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Coordinates.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>
