Class JXG.Sphere3D
JXG.GeometryElement3D,JXG.GeometryElement
↳ JXG.Sphere3D
Creates a new 3D sphere object. Do not use this constructor to create a 3D sphere. Use JXG.View3D#create with
type Sphere3D instead.
Defined in: sphere3d.js.
Extends
JXG.GeometryElement, JXG.GeometryElement3D.
Constructor Attributes | Constructor Name and Description |
---|---|
JXG.Sphere3D(view, method, par1, par2, attributes)
A sphere consists of all points with a given distance from a given point.
|
- Fields borrowed from class JXG.GeometryElement3D:
- 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, 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> |
Elements supporting the 2D representation.
|
The sphere's center.
|
|
The 2D representation of the element.
|
|
The construction method.
|
|
A point on the sphere; only set if the construction method is 'twoPoints'.
|
|
The type of projection (
'parallel' or 'central' ) that the sphere is currently drawn in. |
- Fields borrowed from class JXG.GeometryElement3D:
- 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, 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 |
---|---|
Radius(value)
Calculates the radius of the circle.
|
|
setRadius(r)
Set a new radius, then update the board.
|
- 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.Sphere3D(view, method, par1, par2, attributes)
A sphere consists of all points with a given distance from a given point.
The given point is called the center, and the given distance is called the radius.
A sphere can be constructed by providing a center and a point on the sphere or a center and a radius (given as a number or function).
- Parameters:
- {JXG.View3D} view
- The 3D view the sphere is drawn on.
- {String} method
- Can be:
-
'twoPoints'
– The sphere is defined by its center and a point on the sphere. 'pointRadius'
– The sphere is defined by its center and its radius in user units.
p1
,p2
andradius
must be set according to this method parameter. -
- {JXG.Point3D} par1
- The center of the sphere.
- {JXG.Point3D} par2
- Can be:
- A point on the sphere (if the construction method is
'twoPoints'
) - A number or function (if the construction method is
'pointRadius'
)
- A point on the sphere (if the construction method is
- {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>
{Array}
aux2D
Elements supporting the 2D representation.
{JXG.Point3D}
center
The sphere's center. Do not set this parameter directly, as that will break JSXGraph's update system.
{GeometryElement}
element2D
The 2D representation of the element.
{String}
method
The construction method.
Can be:
'twoPoints'
– The sphere is defined by its center and a point on the sphere.'pointRadius'
– The sphere is defined by its center and its radius in user units.
{JXG.Point3D}
point2
A point on the sphere; only set if the construction method is 'twoPoints'. Do not set this parameter directly, as that will break JSXGraph's update system.
- See:
- JXG.Sphere3D#method
{String}
projectionType
The type of projection (
'parallel'
or 'central'
) that the sphere is currently drawn in.
Method Detail
{Number}
Radius(value)
Calculates the radius of the circle.
- Parameters:
- {String|Number|function} value Optional
- Set new radius
- Returns:
- {Number} The radius of the circle
{JXG.Sphere3D}
setRadius(r)
Set a new radius, then update the board.
- Parameters:
- {String|Number|function} r
- A string, function or number describing the new radius
- Returns:
- {JXG.Sphere3D} Reference to this sphere