Element Point3D
JXG.GeometryElement,JXG.GeometryElement3D
↳ JXG.Point3D
↳ Point3D
A Point3D object is defined by three coordinates [x,y,z], or a function returning an array with three numbers.
Alternatively, all numbers can also be provided as functions returning a number.
Defined in: point3d.js.
Extends
JXG.Point3D.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <private> |
Homogeneous coordinates of a Point3D, i.e.
|
|
If the point is bound to another element ("glides" on that element)
and if the bound reaches the boundary, the point may start cyclically
at the ozher side of the boundary - like one expects from a glider on a sphere.
|
|
| <private> |
Optional slide element, i.e.
|
| Method Attributes | Method Name and Description |
|---|---|
| <private> |
F()
Function or array of functions or array of numbers defining the coordinates of the point, used in updateCoords.
|
| <private> <static> |
Point3D.normalizeCoords()
Normalize homogeneous coordinates such the the first coordinate (the w-coordinate is equal to 1 or 0)-
|
| <static> |
Point3D.setPosition(coords, noevent)
Set the position of a 3D point.
|
| <private> <static> |
Point3D.updateCoords()
Update the array JXG.Point3D#coords containing the homogeneous coords.
|
| <static> |
Point3D.W()
Get w-coordinate of a 3D point.
|
| <static> |
Point3D.X()
Get x-coordinate of a 3D point.
|
| <static> |
Point3D.Y()
Get y-coordinate of a 3D point.
|
| <static> |
Point3D.Z()
Get z-coordinate of a 3D point.
|
- Methods borrowed from class JXG.Point3D:
- distance, initCoords, moveAlong, moveTo, testIfFinite
- 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, setPositionDirectly, setProperty, show, showElement, snapToPoints, toTopOfLayer, 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
Element Detail
Point3D
-
This element has no direct constructor. To create an instance of this element you have to call JXG.Board#create
with type "point3d".
- Possible parent array combinations are:
-
{number|function} x
{number|function} y
{number|function} z
{JXG.GeometryElement3D} [slide=undefined]
- The coordinates are given as x, y, z consisting of numbers or functions. If an optional 3D element "slide" is supplied, the point is a glider on that element. At the time of version v1.11, only elements of type line3d are supperted as glider hosts.
-
{array|function} F
{JXG.GeometryElement3D} [slide=null]
- Alternatively, the coordinates can be supplied as
- function returning an array [x,y,z] of length 3 of numbers or
- array arr=[x,y,z] of length 3 consisting of numbers
- Throws:
- {Exception}
- If the element cannot be constructed with the given parent objects an exception is thrown.
- Examples:
var bound = [-5, 5];
var view = board.create('view3d',
[[-6, -3], [8, 8],
[bound, bound, bound]],
{});
var p = view.create('point3d', [1, 2, 2], { name:'A', size: 5 });
var q = view.create('point3d', function() { return [p.X(), p.Y(), p.Z() - 3]; }, { name:'B', size: 3, fixed: true });
var w = view.create('point3d', [ () => p.X() + 3, () => p.Y(), () => p.Z() - 2], { name:'C', size: 3, fixed: true });
// Glider on sphere
var view = board.create(
'view3d',
[[-6, -3], [8, 8],
[[-3, 3], [-3, 3], [-3, 3]]],
{
depthOrder: {
enabled: true
},
projection: 'central',
xPlaneRear: {fillOpacity: 0.2, gradient: null},
yPlaneRear: {fillOpacity: 0.2, gradient: null},
zPlaneRear: {fillOpacity: 0.2, gradient: null}
}
);
// Two points
var center = view.create('point3d', [0, 0, 0], {withLabel: false, size: 2});
var point = view.create('point3d', [2, 0, 0], {withLabel: false, size: 2});
// Sphere
var sphere = view.create('sphere3d', [center, point], {fillOpacity: 0.8});
// Glider on sphere
var glide = view.create('point3d', [2, 2, 0, sphere], {withLabel: false, color: 'red', size: 4});
var l1 = view.create('line3d', [glide, center], { strokeWidth: 2, dash: 2 });
Field Detail
<private>
{Array}
coords
Homogeneous coordinates of a Point3D, i.e. array of length 4 containing numbers: [w, x, y, z].
Usually, w=1 for finite points and w=0 for points which are infinitely far.
If coordinates of the point are supplied as functions, they are resolved in Point3D#updateCoords into numbers.
p.coords;
{Boolean}
cyclic
If the point is bound to another element ("glides" on that element)
and if the bound reaches the boundary, the point may start cyclically
at the ozher side of the boundary - like one expects from a glider on a sphere.
For this, set cyclic to true.
Defined in: options3d.js.
Defined in: options3d.js.
- Default Value:
- false
<private>
{JXG.GeometryElement3D}
slide
Optional slide element, i.e. element the Point3D lives on.
p.slide;
- Default Value:
- null
Method Detail
<private>
F()
Function or array of functions or array of numbers defining the coordinates of the point, used in updateCoords.
- See:
- updateCoords
<private> <static>
{Object}
Point3D.normalizeCoords()
Normalize homogeneous coordinates such the the first coordinate (the w-coordinate is equal to 1 or 0)-
- Returns:
- {Object} Reference to the Point3D object
- Examples:
p.normalizeCoords();
<static>
{Object}
Point3D.setPosition(coords, noevent)
Set the position of a 3D point.
- Parameters:
- {Array} coords
- 3D coordinates. Either of the form [x,y,z] (Euclidean) or [w,x,y,z] (homogeneous).
- {Boolean} noevent Optional
- If true, no events are triggered (TODO)
- Returns:
- {Object} Reference to the Point3D object
- Examples:
p.setPosition([1, 3, 4]);
<private> <static>
{Object}
Point3D.updateCoords()
Update the array JXG.Point3D#coords containing the homogeneous coords.
- Returns:
- {Object} Reference to the Point3D object
- See:
- GeometryElement3D#update()
- Examples:
p.updateCoords();
<static>
Point3D.W()
Get w-coordinate of a 3D point.
- Returns:
- Number
- Examples:
p.W();
<static>
{Number}
Point3D.X()
Get x-coordinate of a 3D point.
- Returns:
- {Number}
- Examples:
p.X();
<static>
Point3D.Y()
Get y-coordinate of a 3D point.
- Returns:
- Number
- Examples:
p.Y();
<static>
Point3D.Z()
Get z-coordinate of a 3D point.
- Returns:
- Number
- Examples:
p.Z();
Attributes borrowed from other Elements
- 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, ignoreForLabelAutoposition, isLabel, layer, lineCap, 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.Point3D:
- movePath, position
- Fields borrowed from class JXG.GeometryElement3D:
- element2D, is3D, view
- 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.Point3D:
- distance, initCoords, moveAlong, moveTo, testIfFinite
- 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, setPositionDirectly, setProperty, show, showElement, snapToPoints, toTopOfLayer, update, updateRenderer, updateVisibility, useLocale
Events borrowed from other Elements