Personal tools
gvSIG Desktop
gvSIG Desktop

Cached time 11/21/13 17:29:31 Clear cache and reload

 
.. include-document:: org.gvsig.fmap.geom/reference-links
   :rest:

An arc can be created from a central point which works like a radius and another two that will be used to determine the beginning and the end of the arc. In the next example, we will create an arc with the point 0,0 for the radius and from the point 1,0 to the 0,1:

.. code-block:: java

  Point centerPoint = geometryManager.createPoint(0, 0, SUBTYPES.GEOM2D);
  Point startPoint = geometryManager.createPoint(1, 0, SUBTYPES.GEOM2D);
  Point endPoint = geometryManager.createPoint(0, 1, SUBTYPES.GEOM2D);
  Arc arc = (Arc)geometryManager.create(TYPES.ARC, SUBTYPES.GEOM2D);
  arc.setPoints(centerPoint, startPoint, endPoint);

Moreover this way, an arc can be created from a initial point, a radius length and two angles. The next example creates an arc like the created in the previous example, with radius 1 and the beginning on 1,0 (0º) and finnish on 0,1 (90º):
 
.. code-block:: java

  Point centerPoint = geometryManager.createPoint(0, 0, SUBTYPES.GEOM2D);
  Arc arc = (Arc)geometryManager.create(TYPES.ARC, SUBTYPES.GEOM2D);
  arc.setPoints(centerPoint, 1, 0, 90);

View source document


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: