Element Sector
JXG.GeometryElement
↳ JXG.Curve
↳ Sector
A circular sector is a subarea of the area enclosed by a circle. It is enclosed by two radii and an arc.
Defined in: Sector.js.
Extends
JXG.Curve.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
Midpoint of the sector.
|
|
This point together with Sector#point1 defines the radius.
|
|
Defines the sector's angle.
|
Method Attributes | Method Name and Description |
---|---|
hasPointSector(x, y)
Checks whether (x,y) is within the area defined by the sector.
|
|
Radius()
Returns the radius of the sector.
|
Element Detail
Sector
-
This element has no direct constructor. To create an instance of this element you have to call JXG.Board#create
with type "sector".
- Possible parent array combinations are:
-
{JXG.Point} p1
{JXG.Point} p2
{JXG.Point} p1
- A sector is defined by three points: The sector's center p1, a second point p2 defining the radius and a third point p3 defining the angle of the sector. The Sector is always drawn counter clockwise from p2 to p3
- Throws:
- {Error}
- If the element cannot be constructed with the given parent objects an exception is thrown.
- Examples:
// Create an arc out of three free points var p1 = board.create('point', [1.5, 5.0]), p2 = board.create('point', [1.0, 0.5]), p3 = board.create('point', [5.0, 3.0]), a = board.create('sector', [p1, p2, p3]);
Field Detail
{JXG.Point}
point1
Midpoint of the sector.
{JXG.Point}
point2
This point together with Sector#point1 defines the radius..
{JXG.Point}
point3
Defines the sector's angle.
Method Detail
{Boolean}
hasPointSector(x, y)
Checks whether (x,y) is within the area defined by the sector.
- Parameters:
- {Number} x
- Coordinate in x direction, screen coordinates.
- {Number} y
- Coordinate in y direction, screen coordinates.
- Returns:
- {Boolean} True if (x,y) is within the sector defined by the arc, False otherwise.
{Number}
Radius()
Returns the radius of the sector.
- Returns:
- {Number} The distance between Sector#point1 and Sector#point2.
Attributes borrowed from other Elements
- Attributes borrowed from class JXG.Curve:
- curveType, handDrawing
- Attributes borrowed from class JXG.GeometryElement:
- dash, draft, fillColor, fillOpacity, fixed, frozen, highlight, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, needsRegularUpdate, shadow, strokeColor, strokeOpacity, strokeWidth, trace, traceAttributes, visible, withLabel
Fields borrowed from other Elements
- Fields borrowed from class JXG.Curve:
- numberPoints
- Fields borrowed from class JXG.GeometryElement:
- addEvent, ancestors, baseElement, board, childElements, descendants, dump, elementClass, elType, eventHandlers, getAttribute, hasLabel, highlighted, id, isDraggable, isReal, methodMap, mouseover, name, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, stdform, subs, symbolic, traces, transformations, type, visProp
Methods borrowed from other Elements
- Methods borrowed from class JXG.Curve:
- addTransform, allocatePoints, generateTerm, hasPoint, isDistOK, isSegmentOutside, maxX, minX, notifyParents, setPosition, update, updateCurve, updateDataArray, updateParametricCurve, updateParametricCurveNaive, updateRenderer, updateTransform, X, Y, Z
- Methods borrowed from class JXG.GeometryElement:
- _set, addChild, addDescendants, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttributes, getLabelAnchor, getName, getParents, getProperty, getTextAnchor, getType, hideElement, labelColor, noHighlight, normalize, off, on, prepareUpdate, remove, resolveShortcuts, setArrow, setAttribute, setDash, setLabelText, setProperty, setStraight, showElement, triggerEventHandlers