.. _api-zoo-geometry-point: ZOO.Geometry.Point ================== Point geometry class. Inherits from - :ref:`ZOO.Geometry ` Properties ---------- .. list-table:: :widths: 12 50 :header-rows: 1 * - NAME - DESCRIPTION * - :ref:`x ` - {float} * - :ref:`y ` - {float} Functions --------- .. list-table:: :widths: 15 50 :header-rows: 1 * - NAME - DESCRIPTION * - :ref:`ZOO.Geometry.Point ` - Construct a point geometry. * - :ref:`clone ` - {ZOO.Geometry.Point} An exact clone of this ZOO.Geometry.Point * - :ref:`calculateBounds ` - Create a new Bounds based on the x/y * - :ref:`equals ` - Determine whether another geometry is equivalent to this one. * - :ref:`toShortString ` - {String} Shortened String representation of Point object. * - :ref:`move ` - Moves a geometry by the given displacement along positive x and y axes. * - :ref:`rotate ` - Rotate a point around another. * - :ref:`getCentroid ` - {ZOO.Geometry.Point} The centroid of the collection * - :ref:`resize ` - Resize a point relative to some origin. * - :ref:`intersects ` - Determine if the input geometry intersects this one. * - :ref:`transform ` - Translate the x,y properties of the point from source to dest. * - :ref:`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} ` 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} ` 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. "5, 42") .. _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} ` Center point for the rotation .. _getCentroid: getCentroid :: getCentroid: function() *Returns* :ref:`{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} ` Point of origin for resizing | ``ratio {Float}`` Optional x:y ratio for resizing. Default ratio is 1. *Returns* :ref:`{ZOO.Geometry} ` The current geometry. .. _intersects: intersects :: intersects: function(geometry) Determine if the input geometry intersects this one. *Parameters* ``geometry`` :ref:`{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} ` | ``dest`` :ref:`{ZOO.Projection} ` *Returns* :ref:`{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.