JavaScript must be enabled in order for you to use JSXGraph and JSXGraph reference. However, it seems JavaScript is either disabled or not supported by your browser.

Class Index | File Index

Elements

Classes


Class JXG.Polygon

JXG.GeometryElement
      ↳ JXG.Polygon

Polygon stores all style and functional properties that are required to draw and to interactact with a polygon.

Defined in: Polygon.js.
Extends JXG.GeometryElement.

Class Summary
Constructor Attributes Constructor Name and Description
 
JXG.Polygon(board, vertices, attributes)
Creates a new instance of JXG.Polygon.
Attributes Summary
Field Attributes Field Name and Description
 
If true, moving the mouse over inner points triggers hasPoint.
 
Is the polygon bordered by lines?
Fields borrowed from class JXG.GeometryElement:
addEvent, ancestors, baseElement, board, childElements, dash, descendants, draft, dump, elementClass, elType, eventHandlers, fillColor, fillOpacity, fixed, frozen, getAttribute, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isDraggable, isReal, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, type, visible, visProp, withLabel
Field Summary
Field Attributes Field Name and Description
 
References to the border lines of the polygon.
 
References to the points defining the polygon.
Fields borrowed from class JXG.GeometryElement:
addEvent, ancestors, baseElement, board, childElements, dash, descendants, draft, dump, elementClass, elType, eventHandlers, fillColor, fillOpacity, fixed, frozen, getAttribute, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isDraggable, isReal, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, type, visible, visProp, withLabel
Method Summary
Method Attributes Method Name and Description
 
Add more points to the polygon.
 
Area()
returns the area of the polygon
 
Finds the index to a given point reference.
 
return TextAnchor
 
hasPoint(x, y)
Checks whether (x,y) is near the polygon.
 
Hide the polygon including its border lines.
 
Adds more points to the vertex list of the polygon, starting with index
 
This method removes the SVG or VML nodes of the lines and the filled area from the renderer, to remove the object completely you should use JXG.Board#removeObject.
 
Removes given set of vertices from the polygon
 
Make the element visible.
 
Uses the boards renderer to update the polygon.
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttributes, getLabelAnchor, getName, getParents, getProperty, getType, labelColor, noHighlight, normalize, off, on, prepareUpdate, resolveShortcuts, setArrow, setAttribute, setDash, setLabelText, setProperty, setStraight, triggerEventHandlers, update
Class Detail
JXG.Polygon(board, vertices, attributes)
Creates a new instance of JXG.Polygon.
Parameters:
{JXG.Board} board
Reference to the board the polygon is to be drawn on.


{Array} vertices
Unique identifiers for the points defining the polygon. Last point must be first point. Otherwise, the first point will be added at the list.


{Object} attributes
An object which contains properties as given in JXG.Options.elements and JXG.Options.polygon.


Attribute Detail
{Boolean} hasInnerPoints
If true, moving the mouse over inner points triggers hasPoint.
Defined in: Options.js.
See:
JXG.GeometryElement#hasPoint
Default Value:
false

{Boolean} withLines
Is the polygon bordered by lines?
Defined in: Options.js.
Default Value:
true
Field Detail
{Array} borders
References to the border lines of the polygon.

{Array} vertices
References to the points defining the polygon. The last vertex is the same as the first vertex.
Method Detail
{JXG.Polygon} addPoints(%)
Add more points to the polygon. The new points will be inserted at the end.
Parameters:
{%} %
Arbitrary number of points
Returns:
{JXG.Polygon} Reference to the polygon

Area()
returns the area of the polygon

findPoint(p)
Finds the index to a given point reference.
Parameters:
{JXG.Point} p
Reference to an element of type JXG.Point

getTextAnchor()
return TextAnchor

{Boolean} hasPoint(x, y)
Checks whether (x,y) is near the polygon.
Parameters:
{Number} x
Coordinate in x direction, screen coordinates.
{Number} y
Coordinate in y direction, screen coordinates.
Returns:
{Boolean} Returns true, if (x,y) is inside or at the boundary the polygon, otherwise false.

hideElement()
Hide the polygon including its border lines. It will still exist but not visible on the board.

{JXG.Polygon} insertPoints(i, %)
Adds more points to the vertex list of the polygon, starting with index
Parameters:
{Number} i
The position where the new vertices are inserted, starting with 0.
{%} %
Arbitrary number of points to insert.
Returns:
{JXG.Polygon} Reference to the polygon object

remove()
This method removes the SVG or VML nodes of the lines and the filled area from the renderer, to remove the object completely you should use JXG.Board#removeObject.

{JXG.Polygon} removePoints(%)
Removes given set of vertices from the polygon
Parameters:
{%} %
Arbitrary number of vertices as JXG.Point elements or index numbers
Returns:
{JXG.Polygon} Reference to the polygon

showElement()
Make the element visible.

updateRenderer()
Uses the boards renderer to update the polygon.

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Apr 02 2012 18:34:33 GMT+0200 (MESZ)