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
Classes

Element Vectorfield3D

JXG.GeometryElement,JXG.GeometryElement3D
   ↳ JXG.Curve3D
         ↳ Vectorfield3D

3D vector field.

Plot a vector field either given by three functions f1(x, y, z), f2(x, y, z), and f3(x, y, z) or by a function f(x, y, z) returning an array of size 3.

Defined in: curve3d.js.
Extends JXG.Curve3D.

Element Summary
Constructor Attributes Constructor Name and Description
 
Attributes Summary
Field Attributes Field Name and Description
 
Customize arrow heads of vectors.
 
Scaling factor of the vectors.
Method Summary
Method Attributes Method Name and Description
<static>  
Vectorfield3D.setF(func)
Set the defining functions of 3D vector field.
Methods borrowed from class JXG.Curve3D:
X, Y, Z
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, 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
Element Detail
Vectorfield3D
This element has no direct constructor. To create an instance of this element you have to call JXG.Board#create with type "vectorfield3d".

Possible parent array combinations are:
{Array|Function|String} F

Either an array containing three functions f1(x, y, z), f2(x, y, z), and f3(x, y) or function f(x, y, z) returning an array of length 3.


{Array} xData

Array of length 3 containing start value for x, number of steps, end value of x. The vector field will contain (number of steps) + 1 vectors in direction of x.


{Array} yData

Array of length 3 containing start value for y, number of steps, end value of y. The vector field will contain (number of steps) + 1 vectors in direction of y.


{Array} zData

Array of length 3 containing start value for z, number of steps, end value of z. The vector field will contain (number of steps) + 1 vectors in direction of z.


Throws:
{Error}
If the element cannot be constructed with the given parent objects an exception is thrown. Parameter options:
Examples:
const view = board.create('view3d',
    [
        [-6, -3],
        [8, 8],
        [[-3, 3], [-3, 3], [-3, 3]]
    ], {});

var vf = view.create('vectorfield3d', [
    [(x, y, z) => Math.cos(y), (x, y, z) => Math.sin(x), (x, y, z) => z],
    [-2, 5, 2], // x from -2 to 2 in 5 steps
    [-2, 5, 2], // y
    [-2, 5, 2] // z
], {
    strokeColor: 'red',
    scale: 0.5
});


				
                
Attribute Detail
arrowhead
Customize arrow heads of vectors. Be careful! If enabled this will slow down the performance. Fields are:
Defined in: options3d.js.
Default Value:
{enabled: true, size: 5, angle: Math.PI * 0.125}

scale
Scaling factor of the vectors. This in contrast to slope fields, where this attribute sets the vector to the given length.
Defined in: options3d.js.
See:
Slopefield.scale
Default Value:
1
Method Detail
<static> {Object} Vectorfield3D.setF(func)
Set the defining functions of 3D vector field.
Parameters:
{Array|Function} func
Either an array containing three functions f1(x, y, z), f2(x, y, z), and f3(x, y, z) or function f(x, y, z) returning an array of length 3.
Returns:
{Object} Reference to the 3D vector field object.
Examples:
field.setF([(x, y, z) => Math.sin(y), (x, y, z) => Math.cos(x), (x, y, z) => z]);
board.update();

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

Fields borrowed from other Elements
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.Curve3D:
X, Y, Z
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, 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 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 Wed Oct 23 2024 15:44:16 GMT+0200 (Mitteleuropäische Sommerzeit)