« GPGeodeticPoint » : différence entre les versions

De GENOPUS
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
Aucun résumé des modifications
 
Ligne 9 : Ligne 9 :
</syntaxhighlight>
</syntaxhighlight>


* … or without altitude coordinate (only latitude/longitude):
* … or without altitude coordinate (only name/latitude/longitude):


<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
geodWithoutAlt = new GPGeodeticPoint ("Without altitude:", false);
geodWithoutAlt = new GPGeodeticPoint ("Without altitude:", false, true);
</syntaxhighlight>
 
* … or without name (only latitude/longitude/altitude):
 
<syntaxhighlight lang="java">
geodWithoutName = new GPGeodeticPoint ("Without name:", true, false);
</syntaxhighlight>
</syntaxhighlight>



Dernière version du 25 octobre 2017 à 16:02

How to call it

For using the GPGeodeticPoint class, the developer has only to create such an object with these two possibilities:

  • With an altitude coordinate:
geodWithAlt = new GPGeodeticPoint ("With altitude:");
  • … or without altitude coordinate (only name/latitude/longitude):
geodWithoutAlt = new GPGeodeticPoint ("Without altitude:", false, true);
  • … or without name (only latitude/longitude/altitude):
geodWithoutName = new GPGeodeticPoint ("Without name:", true, false);

We also may initialize the widget with predefined values:

GeodeticPoint geodeticPoint =
   new GeodeticPoint(FastMath.toRadians(45.),
                     FastMath.toRadians(10.), 120.e+3);
geodWithoutAlt = new GPGeodeticPoint("Without altitude:",
   geodeticPoint, false);

Note: we may initialize a widget with no display altitude even with a (complete) geodetic point.

Display

For both cases, the display will be:

GPGeodeticPoint.png

How to use it

To get a [PATRIUS (CommonsMath)] Vector3D object, we will just have to call for the getPatriusObject() method as below:

GeodeticPoint point = geodWithAlt.getPatriusObject();

Note: even if the widget is initialized without altitude, this one will be stored in the GeodeticPoint (with a zero value).

How it is stored

Here is the XML format:

  <GeodeticPoint name="With_altitude:">
    <Real name="latitude" unit="deg">4.5E1</Real>
    <Real name="longitude" unit="deg">1.0E1</Real>
    <Real name="altitude" unit="km">1.2E2</Real>
  </GeodeticPoint>
  <GeodeticPoint name="Without_altitude:">
    <Real name="latitude" unit="deg">1.1E1</Real>
    <Real name="longitude" unit="deg">2.2E1</Real>
    <Real name="altitude" unit="km">0.0E0</Real>
  </GeodeticPoint>

Note: same remark as above when the widget is initialized without altitude.