Class JXG.Point3D
JXG.GeometryElement3D,JXG.GeometryElement
↳ JXG.Point3D
Creates a new 3D point object. Do not use this constructor to create a 3D point. Use JXG.View3D#create with
type Point3D instead.
Defined in: point3d.js.
Extends
JXG.GeometryElement, JXG.GeometryElement3D.
Constructor Attributes | Constructor Name and Description |
---|---|
JXG.Point3D(view, F, slide, attributes)
A 3D point is the basic geometric element.
|
- Fields borrowed from class JXG.GeometryElement3D:
- element2D, is3D, view
- 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, ignoreForLabelAutoposition, 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
Field Attributes | Field Name and Description |
---|---|
<private> <static> |
JXG.Point3D.endpoints
Shadow points that determine the visible line.
|
<private> |
An array of coordinates for moveTo().
|
<private> |
In case, the point is a glider, store the preimage of the coordinates in terms of the parametric definition of the host element.
|
- Fields borrowed from class JXG.GeometryElement3D:
- element2D, is3D, view
- 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, ignoreForLabelAutoposition, 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
Method Attributes | Method Name and Description |
---|---|
distance(pt)
Calculate the distance from one point to another.
|
|
<private> |
Initialize the coords array.
|
moveAlong(traversePath, time, options)
Move along a path defined by an array of coordinates
|
|
moveTo(where, time, options)
Starts an animated point movement towards the given coordinates where.
|
|
Check whether a point's position is finite, i.e.
|
- 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, hasPoint, 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, update, updateRenderer, 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
Class Detail
JXG.Point3D(view, F, slide, attributes)
A 3D point is the basic geometric element.
- Parameters:
- {JXG.View3D} view
- The 3D view the point is drawn on.
- {Function|Array} F
- Array of numbers, array of functions or function returning an array with defines the user coordinates of the point.
- {JXG.GeometryElement3D} slide
- Object the 3D point should be bound to. If null, the point is a free point.
- {Object} attributes
- An object containing visual properties like in JXG.Options#point3d and JXG.Options#elements, and optional a name and an id.
Field Detail
<private> <static>
{Array}
JXG.Point3D.endpoints
Shadow points that determine the visible line.
This is of relevance if the line is defined by two points and has straightFirst or straightLast set to true.
In such a case, the shadow points are the intersection of the line with the cube.
Defined in: linspace3d.js.
Defined in: linspace3d.js.
<private>
{Array}
movePath
An array of coordinates for moveTo(). An in-progress move can be updated or cancelled by updating or clearing this array. Use moveTo() instead of
accessing this array directly.
<private>
{Array}
position
In case, the point is a glider, store the preimage of the coordinates in terms of the parametric definition of the host element.
That is, if the host element `slide` is a curve, and the coordinates of the point are equal to `p` and `u = this.position[0]`, then
`p = [slide.X(u), slide.Y(u), slide.Z(u)]`.
Method Detail
{Number}
distance(pt)
Calculate the distance from one point to another. If one of the points is on the plane at infinity, return positive infinity.
- Parameters:
- {JXG.Point3D} pt
- The point to which the distance is calculated.
- Returns:
- {Number} The distance
<private>
{Object}
initCoords()
Initialize the coords array.
- Returns:
- {Object} Reference to the Point3D object
moveAlong(traversePath, time, options)
Move along a path defined by an array of coordinates
- Parameters:
- {number[][]} traversePath Optional
- Array of path coordinates (either cartesian or homogenous).
- {number} time Optional
- Number of milliseconds the animation should last.
- {Object} options Optional
- 'callback' and 'interpolate'. see JXG.CoordsElement#moveAlong,
- Examples:
const board = JXG.JSXGraph.initBoard('jxgbox') var view = board.create( 'view3d', [[-6, -3], [8, 8], [[-3, 3], [-3, 3], [-3, 3]]]); board.create('button', [-4, 4.5, 'start', () => { let A = view.create('point3d', [0, 0, 0]); A.moveAlong([[3, 3, 3], [-2, -1, -2], [-1, -1, -1], [-1, -2, 1]], 3000, { callback: () => board.create('text', [-4, 4, 'done!']) }) }])
moveTo(where, time, options)
Starts an animated point movement towards the given coordinates where.
The animation is done after time milliseconds.
If the second parameter is not given or is equal to 0, coordinates are changed without animation.
- Parameters:
- {Array} where
- Array containing the target coordinate in cartesian or homogenous form.
- {Number} time Optional
- Number of milliseconds the animation should last.
- {Object} options Optional
- Optional settings for the animation
- {function} options.callback Optional
- A function that is called as soon as the animation is finished.
- {String} options.effect Optional, Default: '<>'|'>'|'<'
- animation effects like speed fade in and out. possible values are '<>' for speed increase on start and slow down at the end (default), '<' for speed up, '>' for slow down, and '--' for constant speed during the whole animation.
- See:
- JXG.Point3D#moveAlong
- JXG.Point#moveTo
- Examples:
// visit a coordinate, then use callback to visit a second coordinate. const board = JXG.JSXGraph.initBoard('jxgbox') var view = board.create( 'view3d', [[-6, -3], [8, 8], [[-3, 3], [-3, 3], [-3, 3]]]); let A = view.create('point3d', [0, 0, 0]); // move A with callbacks board.create('button', [-4, 4.3, 'callbacks', () => { A.moveTo([3, 3, 3], 3000, { callback: () => A.moveTo([-3, -3, -3], 3000, { callback: () => A.moveTo([0, 0, 0],1000), effect: '<' }), effect: '>' }) }]) // move A with async/await board.create('button', [-3, 4.3, 'async/await', async () => { await A.moveTo([3, 3, 3], 3000, { effect: '>' }); await A.moveTo([-3, -3, -3], 3000, { effect: '<' }); A.moveTo([0, 0, 0],1000) }])
{Boolean}
testIfFinite()
Check whether a point's position is finite, i.e. the first entry is not zero.
- Returns:
- {Boolean} True if the first entry of the coordinate vector is not zero; false otherwise.