.. _api-zoo-geometry-point:

ZOO.Geometry.Point
==================

Point geometry class.

Inherits from

- :ref:`ZOO.Geometry <api-zoo-geometry>`

Properties	
----------

.. list-table::
   :widths: 12 50
   :header-rows: 1

   * - NAME
     - DESCRIPTION
   * - :ref:`x <x>`
     - {float}
   * - :ref:`y <y>`
     - {float}

Functions	
---------

.. list-table::
   :widths: 15 50
   :header-rows: 1

   * - NAME
     - DESCRIPTION   
   * - :ref:`ZOO.Geometry.Point <ZOO.Geometry.Point>`
     - Construct a point geometry.
   * - :ref:`clone <clone>`
     - {ZOO.Geometry.Point} An exact clone of this ZOO.Geometry.Point   
   * - :ref:`calculateBounds <calculateBounds>`
     - Create a new Bounds based on the x/y
   * - :ref:`equals <equals>`
     - Determine whether another geometry is equivalent to this one.
   * - :ref:`toShortString <toShortString>`
     - {String} Shortened String representation of Point object.
   * - :ref:`move <move>`
     - Moves a geometry by the given displacement along positive x and y axes.
   * - :ref:`rotate <rotate>`
     - Rotate a point around another.
   * - :ref:`getCentroid <getCentroid>`
     - {ZOO.Geometry.Point} The centroid of the collection 
   * - :ref:`resize <resize>`
     - Resize a point relative to some origin.
   * - :ref:`intersects <intersects>`
     - Determine if the input geometry intersects this one.  
   * - :ref:`transform <transform>`
     - Translate the x,y properties of the point from source to dest.
   * - :ref:`getVertices <getVertices>`
     - Return a list of all points in this geometry.      
   
     
**Properties**
       
.. _x: 

x	
  ``{float}``
  
.. _y:  
  
y	
  ``{float}``
  
**Functions**  

.. _ZOO.Geometry.Point:  

ZOO.Geometry.Point	
  Construct a point geometry.

  *Parameters*
  
  | ``x	{float}``
  | ``y	{float}``
  
.. _clone:  
  
clone	
  ::
  
    clone: function(obj)

  *Returns*

  :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` An exact clone of this ZOO.Geometry.Point 
  
.. _calculateBounds:    
  
calculateBounds	
  ::
  
    calculateBounds: function ()

  Create a new Bounds based on the x/y  
  
.. _equals:      
  
equals	
  ::
  
    equals: function(geom)

  Determine whether another geometry is equivalent to this one.  Geometries are considered 
  equivalent if all components have the same coordinates.
  
  *Parameters*
  
  ``geom`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` The geometry to test.
  
  *Returns*

  ``{Boolean}`` The supplied geometry is equivalent to this geometry.
  
.. _toShortString:        
  
toShortString	
  ::
  
    toShortString: function()

  *Returns*

  ``{String}`` Shortened String representation of Point object.  (ex.  <i>"5, 42"</i>)  
  
.. _move:          
  
move	
  ::
  
    move: function(x,y)

  Moves a geometry by the given displacement along positive x and y axes.  This modifies 
  the position of the geometry and clears the cached bounds.

  *Parameters*
  
  | ``x {Float}`` Distance to move geometry in positive x direction.
  | ``y	{Float}`` Distance to move geometry in positive y direction. 
  
.. _rotate:            
  
rotate	
  ::
  
    rotate: function(angle,origin)

  Rotate a point around another.
  
  *Parameters*
  
  | ``angle {Float}`` Rotation angle in degrees (measured counterclockwise from the positive x-axis)
  | ``origin`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` Center point for the rotation 

.. _getCentroid:             
 
getCentroid	
  ::
  
    getCentroid: function()

  *Returns*

  :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` The centroid of the collection  
  
.. _resize:               
  
resize	
  ::
  
    resize: function(scale,origin,ratio)

  Resize a point relative to some origin.  For points, this has the effect of scaling a 
  vector (from the origin to the point).  This method is more useful on geometry collection 
  subclasses.
  
  *Parameters*
  
  | ``scale {Float}`` Ratio of the new distance from the origin to the old distance from the origin.  A scale of 2 doubles the distance between the point and origin.
  | ``origin`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` Point of origin for resizing
  | ``ratio {Float}`` Optional x:y ratio for resizing.  Default ratio is 1.

  *Returns*
  
  :ref:`{ZOO.Geometry} <api-zoo-geometry>` The current geometry.  
  
.. _intersects:                 
  
intersects	
  ::
  
    intersects: function(geometry)

  Determine if the input geometry intersects this one.
  
  *Parameters*
  
  ``geometry`` :ref:`{ZOO.Geometry} <api-zoo-geometry>` Any type of geometry.

  *Returns*

  ``{Boolean}`` The input geometry intersects this one. 
  
.. _transform:                   
  
transform	
  ::
  
    transform: function(source,dest)

  Translate the x,y properties of the point from source to dest.
  
  *Parameters*
  
  | ``source`` :ref:`{ZOO.Projection} <api-zoo-projection>`
  | ``dest`` :ref:`{ZOO.Projection} <api-zoo-projection>`
  
  *Returns*

  :ref:`{ZOO.Geometry} <api-zoo-geometry>`
  
.. _getVertices:                     
  
getVertices	
  ::
  
    getVertices: function(nodes)

  Return a list of all points in this geometry.
  
  *Parameters*
  
  ``nodes {Boolean}`` For lines, only return vertices that are endpoints.  If false, for lines, 
  only vertices that are not endpoints will be returned.  If not provided, all vertices will be returned.

  *Returns*

  ``{Array}`` A list of all vertices in the geometry.