# JSXGraph 1.11.1 Reference

## 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

- Angle
- Arc
- Arrow
- Arrowparallel
- Axes3D
- Axis
- Axis3D
- Bisector
- Bisectorlines
- Boxplot
- Button
- Cardinalspline
- Chart
- Checkbox
- Circle
- Circle3D
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Comb
- Conic
- Curve
- Curve3D
- CurveDifference
- CurveIntersection
- CurveUnion
- Derivative
- Ellipse
- Face3D
- ForeignObject
- Functiongraph
- Functiongraph3D
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- ImplicitCurve
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- IntersectionCircle3D
- IntersectionLine3D
- Label
- Legend
- Line
- Line3D
- MajorArc
- MajorSector
- Measurement
- Mesh3D
- Metapostspline
- Midpoint
- MinorArc
- MinorSector
- MirrorElement
- MirrorPoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelogram
- Parallelpoint
- ParametricSurface3D
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Plane3D
- Point
- Point3D
- PolarLine
- PolePoint
- Polygon
- Polygon3D
- PolygonalChain
- Polyhedron3D
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopefield
- Slopetriangle
- Smartlabel
- Sphere3D
- Spline
- Stepfunction
- Tangent
- TangentTo
- Tapemeasure
- Text
- Text3D
- Ticks
- Ticks3D
- Tracecurve
- Transformation
- Transformation3D
- Turtle
- Vectorfield
- Vectorfield3D
- View3D

Classes

- _global_
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.Board.infobox
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Chart
- JXG.Circle
- JXG.Circle3D
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Curve3D
- JXG.Dump
- JXG.EventEmitter
- JXG.Expect
- JXG.Face3D
- JXG.ForeignObject
- JXG.GeometryElement
- JXG.GeometryElement3D
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Legend
- JXG.Line
- JXG.Line3D
- JXG.Math
- JXG.Math.BoxQuadtree
- JXG.Math.Clip
- JXG.Math.Extrapolate
- JXG.Math.Geometry
- JXG.Math.ImplicitPlot
- JXG.Math.IntervalArithmetic
- JXG.Math.Metapost
- JXG.Math.Nlp
- JXG.Math.Numerics
- JXG.Math.Plot
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.ProbFuncs
- JXG.Math.Quadtree
- JXG.Math.Statistics
- JXG.NoRenderer
- JXG.Options
- JXG.Plane3D
- JXG.Point
- JXG.Point3D
- JXG.Polygon
- JXG.Polygon3D
- JXG.PrefixParser
- JXG.Sphere3D
- JXG.Surface3D
- JXG.SVGRenderer
- JXG.Text
- JXG.Text3D
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.View3D
- JXG.VMLRenderer
- JXG.XML

# 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.

The sector as curve consists of two legs and an arc. The curve length is 6. That means, a point with coordinates [sector.X(t), sector.Y(t)] is on

- leg 1 if t is between 0 and 1,
- the arc if t is between 1 and 5,
- leg 2 if t is between 5 and 6.

Defined in: sector.js.
Extends JXG.Curve.

Element Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Sector

Attributes Summary
Field Attributes | Field Name and Description
--- | ---
| anglePoint Attributes for helper point anglepoint in case it is provided by coordinates.
| arc Attributes for sub-element arc.
| center Attributes for helper point center in case it is provided by coordinates.
| label Attributes for the sector label.
| radiusPoint Attributes for helper point radiuspoint in case it is provided by coordinates.
| selection Type of sector.

Field Summary
Field Attributes | Field Name and Description
--- | ---
| point1 Midpoint of the sector.
| point2 This point together with Sector#point1 defines the radius.
| point3 Defines the sector's angle.
| point4 Defines the sectors orientation in case of circumCircleSectors.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| Area() Area of the sector.
<private> | autoRadius() Sets radius if the attribute `radius` has value 'auto'.
| hasPointSector(x, y) Checks whether (x,y) is within the area defined by the sector.
| L() Arc length.
| Perimeter() Sector perimeter, i.e.
| Radius() Returns the radius of the sector.
<private> | setPositionDirectly(method, coords, oldcoords) Moves the sector by the difference of two coordinates.
| setRadius(value) Overwrite the Radius method of the sector.
| Value(unit) Length of the sector's arc or the angle in various units, see Arc#Value.

Methods borrowed from class JXG.Curve:
  addTransform, allocatePoints, generateTerm, getLabelPosition, getTransformationSource, hasPoint, interpolationFunctionFromArray, maxX, minX, moveTo, notifyParents, update, updateCurve, updateDataArray, updateRenderer, updateTransform, X, Y, Z
Methods borrowed from class JXG.GeometryElement:
  _set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, eval, evalVisProp, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, hide, hideElement, noHighlight, normalize, prepareUpdate, remove, removeAllTicks, removeChild, removeDescendants, removeTicks, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setProperty, show, showElement, snapToPoints, updateVisibility, useLocale

Events borrowed from class JXG.GeometryElement:
  attribute, attribute:key, down, drag, keydrag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, pendown, pendrag, penup, touchdown, touchdrag, touchup, up

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} p3
  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`.

  In this case, the sector will have an arc as sub-object.

  Second possibility of input parameters are:

  line2, coords1 or direction1, coords2 or direction2, radius The sector is defined by two lines. The two legs which define the sector are given by two coordinates arrays which are projected initially to the two lines or by two directions (+/- 1). If the two lines are parallel, two of the defining points on different lines have to coincide. This will be the center of the sector. The last parameter is the radius of the sector.

  In this case, the sector will not have an arc as sub-object.

Throws:
{Error}
  If the element cannot be constructed with the given parent objects an exception is thrown. First possibility of input parameters are:

Examples:

    // Create a sector 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]);

    // Create a sector out of two lines, two directions and a radius
    var p1 = board.create('point', [-1, 4]),
     p2 = board.create('point', [4, 1]),
     q1 = board.create('point', [-2, -3]),
     q2 = board.create('point', [4,3]),

     li1 = board.create('line', [p1,p2], {strokeColor:'black', lastArrow:true}),
     li2 = board.create('line', [q1,q2], {lastArrow:true}),

     sec1 = board.create('sector', [li1, li2, [5.5, 0], [4, 3], 3]),
     sec2 = board.create('sector', [li1, li2, 1, -1, 4]);

    var t = board.create('transform', [2, 1.5], {type: 'scale'});
    var s1 = board.create('sector', [[-3.5,-3], [-3.5, -2], [-3.5,-4]], {
                    anglePoint: {visible:true}, center: {visible: true}, radiusPoint: {visible: true},
                    fillColor: 'yellow', strokeColor: 'black'});
    var s2 = board.create('curve', [s1, t], {fillColor: 'yellow', strokeColor: 'black'});

    var A = board.create('point', [3, -2]),
        B = board.create('point', [-2, -2]),
        C = board.create('point', [0, 4]);

    var angle = board.create('sector', [B, A, C], {
            strokeWidth: 0,
            arc: {
            	visible: true,
            	strokeWidth: 3,
              lastArrow: {size: 4},
              firstArrow: {size: 4}
            }
          });
    //angle.arc.setAttribute({firstArrow: false});
    angle.arc.setAttribute({lastArrow: false});

Attribute Detail
{Point} anglePoint
Attributes for helper point anglepoint in case it is provided by coordinates.
Defined in: options.js.

{Arc} arc
Attributes for sub-element arc. It is only available, if the sector is defined by three points.
Defined in: options.js.

Default Value:
  '{visible:false}'

{Point} center
Attributes for helper point center in case it is provided by coordinates.
Defined in: options.js.

{Label} label
Attributes for the sector label.
Defined in: options.js.

{Point} radiusPoint
Attributes for helper point radiuspoint in case it is provided by coordinates.
Defined in: options.js.

{String} selection
Type of sector. Possible values are 'minor', 'major', and 'auto'.
Defined in: options.js.

Default Value:
  'auto'

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.

{JXG.Point} point4
Defines the sectors orientation in case of circumCircleSectors.
Method Detail
{Number} Area()
Area of the sector.

Returns:
  {Number} The area of the sector.

<private> {Number} autoRadius()
Sets radius if the attribute `radius` has value 'auto'. Sets a radius between 20 and 50 points, depending on the distance between the center and the radius point. This function is used in Angle.

Returns:
  {Number} returns a radius value in user coordinates.

{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} L()
Arc length.

Returns:
  {Number} Length of the sector's arc.

See:
  Arc#L

{Number} Perimeter()
Sector perimeter, i.e. arc length plus 2 * radius.

Returns:
  {Number} Perimeter of sector.

{Number} Radius()
Returns the radius of the sector.

Returns:
  {Number} The distance between Sector#point1 and Sector#point2.

<private> {JXG.Curve} setPositionDirectly(method, coords, oldcoords)
Moves the sector by the difference of two coordinates.

Parameters:
{Number} method
  The type of coordinates used here. Possible values are JXG.COORDS_BY_USER and JXG.COORDS_BY_SCREEN.
{Array} coords
  coordinates in screen/user units
{Array} oldcoords
  previous coordinates in screen/user units

Returns:
  {JXG.Curve} this element

setRadius(value)
Overwrite the Radius method of the sector. Used in GeometryElement#setAttribute.

Parameters:
{Number|Function} value
  New radius.

{Number} Value(unit)
Length of the sector's arc or the angle in various units, see Arc#Value.

Parameters:
{String} unit

Returns:
  {Number} The arc length or the angle value in various units.

See:
  Arc#Value

Attributes borrowed from other Elements

Attributes borrowed from class JXG.Curve:
  lineCap
Attributes borrowed from class JXG.GeometryElement:
  aria, cssClass, dash, dashScale, draft, dragToTopOfLayer, element3D, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, highlight, highlightCssClass, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, isLabel, layer, needsRegularUpdate, nonnegativeOnly, precision, priv, rotatable, scalable, shadow, snapToGrid, strokeColor, strokeOpacity, strokeWidth, tabindex, trace, traceAttributes, transitionDuration, transitionProperties, visible, withLabel

Fields borrowed from other Elements

Fields borrowed from class JXG.Curve:
  dataX, dataY, numberPoints, qdt, ticks
Fields borrowed from class JXG.GeometryElement:
  _org_type, _pos, ancestors, baseElement, board, childElements, descendants, dump, elementClass, elType, hasLabel, highlighted, id, inherits, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsUpdate, notExistingParents, numTraces, parents, quadraticform, rendNode, stdform, subs, symbolic, traces, transformations, type, visProp, visPropCalc

Methods borrowed from other Elements

Methods borrowed from class JXG.Curve:
  addTransform, allocatePoints, generateTerm, getLabelPosition, getTransformationSource, hasPoint, interpolationFunctionFromArray, maxX, minX, moveTo, notifyParents, update, updateCurve, updateDataArray, updateRenderer, updateTransform, X, Y, Z
Methods borrowed from class JXG.GeometryElement:
  _set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, eval, evalVisProp, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, hide, hideElement, noHighlight, normalize, prepareUpdate, remove, removeAllTicks, removeChild, removeDescendants, removeTicks, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setProperty, show, showElement, snapToPoints, updateVisibility, useLocale

Events borrowed from other Elements

Events borrowed from class JXG.GeometryElement:
  attribute, attribute:key, down, drag, keydrag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, pendown, pendrag, penup, touchdown, touchdrag, touchup, up

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Apr 04 2025 09:22:42 GMT+0200 (Mitteleuropäische Sommerzeit)