Class JXG.Point
JXG.GeometryElement,JXG.CoordsElement
↳ JXG.Point
Creates a new point object. Do not use this constructor to create a point. Use JXG.Board#create with
type Point, Glider, or Intersection instead.
Defined in: point.js.
Extends
JXG.CoordsElement, JXG.GeometryElement.
Constructor Attributes | Constructor Name and Description |
---|---|
JXG.Point(board, coordinates, attributes)
A point is the basic geometric element.
|
- Fields borrowed from class JXG.GeometryElement:
- _org_type, _pos, ancestors, aria, baseElement, board, childElements, cssClass, dash, dashScale, descendants, draft, dragToTopOfLayer, dump, element3D, elementClass, elType, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, hasLabel, highlight, highlightCssClass, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isLabel, isReal, lastDragTime, layer, lineCap, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, nonnegativeOnly, notExistingParents, numTraces, parents, precision, priv, quadraticform, rendNode, rotatable, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, tabindex, trace, traceAttributes, traces, transformations, transitionDuration, transitionProperties, type, visible, visProp, visPropCalc, withLabel
- Fields borrowed from class JXG.CoordsElement:
- coords, groups, isConstrained, needsUpdateFromParent, onPolygon, position, slideObject, slideObjects
- Fields borrowed from class JXG.GeometryElement:
- _org_type, _pos, ancestors, aria, baseElement, board, childElements, cssClass, dash, dashScale, descendants, draft, dragToTopOfLayer, dump, element3D, elementClass, elType, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, hasLabel, highlight, highlightCssClass, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isLabel, isReal, lastDragTime, layer, lineCap, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, nonnegativeOnly, notExistingParents, numTraces, parents, precision, priv, quadraticform, rendNode, rotatable, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, tabindex, trace, traceAttributes, traces, transformations, transitionDuration, transitionProperties, type, visible, visProp, visPropCalc, withLabel
- Fields borrowed from class JXG.CoordsElement:
- coords, groups, isConstrained, needsUpdateFromParent, onPolygon, position, slideObject, slideObjects
Method Attributes | Method Name and Description |
---|---|
<deprecated> |
face(f)
Set the face of a point element.
|
<private> |
hasPoint(x, y)
Checks whether (x,y) is near the point.
|
isOn(el, tol)
Test if the point is on (is incident with) element "el".
|
|
makeIntersection(el1,, el2, i, j)
Convert the point to intersection point and update the construction.
|
|
<deprecated> | |
<private> |
setStyle(i)
Set the style of a point.
|
<deprecated> |
size(s)
Set the size of a point element
|
update(fromParent)
Updates the position of the point.
|
|
<private> |
Calls the renderer to update the drawing.
|
updateTransform(fromParent)
Applies the transformations of the element to JXG.Point#baseElement.
|
- Methods borrowed from class JXG.GeometryElement:
- _set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, addTransform, 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, setPositionDirectly, setProperty, show, showElement, snapToPoints, updateVisibility, useLocale
- Methods borrowed from class JXG.CoordsElement:
- _anim, addAnchor, addConstraint, Coords, Dist, findClosestSnapValue, free, handleAttractors, handleSnapToPoints, makeGlider, moveAlong, moveTo, popSlideObject, setGliderPosition, setPositionByTransform, updateConstraint, updateCoords, updateGlider, updateGliderFromParent, visit, X, XEval, Y, YEval, Z, ZEval
- 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
Class Detail
JXG.Point(board, coordinates, attributes)
A point is the basic geometric element. Based on points lines and circles can be constructed which can be intersected
which in turn are points again which can be used to construct new lines, circles, polygons, etc. This class holds methods for
all kind of points like free points, gliders, and intersection points.
- Parameters:
- {string|JXG.Board} board
- The board the new point is drawn on.
- {Array} coordinates
- An array with the user coordinates of the point.
- {Object} attributes
- An object containing visual properties like in JXG.Options#point and JXG.Options#elements, and optional a name and an id.
Method Detail
face(f)
Set the face of a point element.
- Parameters:
- {String} f
- String which determines the face of the point. See JXG.GeometryElement#face for a list of available faces.
- Deprecated:
- Use setAttribute()
- See:
- JXG.GeometryElement#face
<private>
{Boolean}
hasPoint(x, y)
Checks whether (x,y) is near the point.
- Parameters:
- {Number} x
- Coordinate in x direction, screen coordinates.
- {Number} y
- Coordinate in y direction, screen coordinates.
- Returns:
- {Boolean} True if (x,y) is near the point, False otherwise.
{Boolean}
isOn(el, tol)
Test if the point is on (is incident with) element "el".
- Parameters:
- {JXG.GeometryElement} el
- {Number} tol
- Returns:
- {Boolean}
- Examples:
var circ = board.create('circle', [[-2, -2], 1]); var seg = board.create('segment', [[-1, -3], [0,0]]); var line = board.create('line', [[1, 3], [2, -2]]); var po = board.create('point', [-1, 0], {color: 'blue'}); var curve = board.create('functiongraph', ['sin(x)'], {strokeColor: 'blue'}); var pol = board.create('polygon', [[2,2], [4,2], [4,3]], {strokeColor: 'blue'}); var point = board.create('point', [-1, 1], { attractors: [line, seg, circ, po, curve, pol], attractorDistance: 0.2 }); var txt = board.create('text', [-4, 3, function() { return 'point on line: ' + point.isOn(line) + '
' + 'point on seg: ' + point.isOn(seg) + '
' + 'point on circ = ' + point.isOn(circ) + '
' + 'point on point = ' + point.isOn(po) + '
' + 'point on curve = ' + point.isOn(curve) + '
' + 'point on polygon = ' + point.isOn(pol) + '
'; }]);
makeIntersection(el1,, el2, i, j)
Convert the point to intersection point and update the construction.
To move the point visual onto the intersection, a call of board update is necessary.
- Parameters:
- {String|Object} el1,
- el2, i, j The intersecting objects and the numbers.
- el2
- i
- j
{*}
normalizeFace(s)
- Parameters:
- s
- Deprecated:
- Use JXG#normalizePointFace instead
- Returns:
- {*}
<private>
setStyle(i)
Set the style of a point.
Used for GEONExT import and should not be used to set the point's face and size.
- Parameters:
- {Number} i
- Integer to determine the style.
size(s)
Set the size of a point element
- Parameters:
- {Number} s
- Integer which determines the size of the point.
- Deprecated:
- Use setAttribute()
- See:
- JXG.GeometryElement#size
update(fromParent)
Updates the position of the point.
- Parameters:
- fromParent
<private>
updateRenderer()
Calls the renderer to update the drawing.
{JXG.CoordsElement}
updateTransform(fromParent)
Applies the transformations of the element to JXG.Point#baseElement.
Point transformations are relative to a base element.
- Parameters:
- {Boolean} fromParent
- True if the drag comes from a child element. This is the case if a line through two points is dragged. Otherwise, the element is the drag element and we apply the the inverse transformation to the baseElement if is different from the element.
- Returns:
- {JXG.CoordsElement} Reference to this object.