Class Polygon
Extends
JXG.Polygon.
A polygon is an area enclosed by a set of border lines which are determined by a list of points. Each two
consecutive points of the list define a line.
Defined in: Polygon.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Polygon(vertices)
|
- Fields borrowed from class JXG.Polygon:
- borders, hasInnerPoints, vertices, withLines
- Fields borrowed from class JXG.GeometryElement:
- addEvent, ancestors, 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, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, type, visible, visProp, withLabel
- Methods borrowed from class JXG.Polygon:
- addPoints, Area, findPoint, getTextAnchor, hasPoint, hideElement, insertPoints, remove, removePoints, setPositionDirectly, showElement, updateRenderer
- Methods borrowed from class JXG.GeometryElement:
- addChild, addRotation, addTransform, animate, bounds, clearTrace, cloneToBackground, createLabel, getAttributes, getLabelAnchor, getName, getParents, getProperty, getType, labelColor, noHighlight, off, on, resolveShortcuts, setArrow, setAttribute, setLabelText, setProperty, triggerEventHandlers, update
- Events borrowed from class JXG.GeometryElement:
- attribute, attribute:<attribute><attribute>, down, drag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, touchdown, touchdrag, touchup, up
Class Detail
Polygon(vertices)
var p1 = board.create('point', [0.0, 2.0]); var p2 = board.create('point', [2.0, 1.0]); var p3 = board.create('point', [4.0, 6.0]); var p4 = board.create('point', [1.0, 3.0]); var pol = board.create('polygon', [p1, p2, p3, p4]);
- Parameters:
- {Array} vertices
- The polygon's vertices. If the first and the last vertex don't match the first one will be added to the array by the creator.
- Throws:
- {Exception}
- If the element cannot be constructed with the given parent objects an exception is thrown.