<parabola>
<parabola> is a Graphical
component that renders a parabola when nested inside a <graph> component.
Attributes and Properties
Attributes for <parabola>
Number display (5)
avoidScientificNotationboolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.
displayDecimalsinteger. Default value: 2. Number of decimal places to display when rendering this number.
displayDigitsinteger. Default value: 3. Number of significant digits to display when rendering this number.
displaySmallAsZeronumber. Default value: 1e-14. Threshold below which numbers are displayed as zero.
padZerosboolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Labels (1)
labelIsNameboolean. Default value: false. Whether to use this component's name as its rendered label.
Other (17)
applyStyleToLabelboolean. Default value: false. Whether to apply this component's selected style to its label.
draggableboolean. Default value: true. Whether the curve can be dragged on a graph.
extrapolateBackwardboolean. Default value: false. Whether to extrapolate the curve before its first defined point.
extrapolateForwardboolean. Default value: false. Whether to extrapolate the curve beyond its last defined point.
boolean. Default value: false. Whether to swap the function and its argument (i.e., reflect across y=x).
labelPositionkeyword. Position of the curve's label relative to the curve.
| Value | Description |
|---|---|
upperRight (default) | Place the label above and to the right of the curve. |
upperLeft | Place the label above and to the left of the curve. |
lowerRight | Place the label below and to the right of the curve. |
lowerLeft | Place the label below and to the left of the curve. |
top | Place the label directly above the curve. |
bottom | Place the label directly below the curve. |
left | Place the label directly to the left of the curve. |
right | Place the label directly to the right of the curve. |
layerinteger. Default value: 0. Z-order layer index used to stack graphical components (higher values render on top).
lineStylekeyword. Stroke style for lines.
| Value | Description |
|---|---|
solid | Continuous, unbroken stroke. |
dashed | Stroke composed of evenly-spaced dashes. |
dotted | Stroke composed of evenly-spaced dots. |
lineWidthnumber. Stroke width for lines, in pixels.
nearestPointAsCurveboolean. Default value: false. Whether nearest-point queries should treat this as a curve in the plane rather than a graph y = f(x).
numDiscretizationPointsnumber. Default value: 1000. Number of points used when discretizing the curve for rendering.
periodicboolean. Default value: false. Whether the curve is treated as periodic when interpolating between control points.
showCoordsWhenDraggingboolean. Default value: true. Whether to show coordinate labels while dragging the curve.
splineFormkeyword. Form of spline used to interpolate between control points.
| Value | Description |
|---|---|
centripetal (default) | Centripetal Catmull-Rom spline (avoids self-intersection at sharp turns). |
uniform | Uniform Catmull-Rom spline with evenly spaced parameterization. |
splineTensionnumber. Default value: 0.8. Tension parameter used when fitting a spline through control points.
pointList. Points the parabola passes through.
[ point ]. The vertex of the parabola.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <parabola name="p">
Number display (5)
$p.avoidScientificNotationboolean. Whether to render numbers in full decimal form rather than scientific notation.
$p.displayDecimalsinteger. Number of decimal places to display when rendering this number.
$p.displayDigitsinteger. Number of significant digits to display when rendering this number.
$p.displaySmallAsZeronumber. Threshold below which numbers are displayed as zero.
$p.padZerosboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Labels (2)
$p.labellabel. The label rendered with this component.
$p.labelIsNameboolean. Whether to use this component's name as its rendered label.
Other (26)
$p.anumber. The leading coefficient of the parabola (in y = a x^2 + b x + c).
$p.applyStyleToLabelboolean. Whether to apply this component's selected style to its label.
$p.bnumber. The linear coefficient in y = a x^2 + b x + c.
$p.cnumber. The constant term in y = a x^2 + b x + c.
$p.disabledboolean. Whether this component is disabled and cannot be interacted with.
$p.draggableboolean. Whether the curve can be dragged on a graph.
$p.equationmath. The parabola's equation as a math expression.
$p.extrapolateBackwardboolean. Whether to extrapolate the curve before its first defined point.
$p.extrapolateForwardboolean. Whether to extrapolate the curve beyond its last defined point.
$p.fixedboolean. Whether this component's value is fixed and cannot be modified.
$p.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$p.flipFunctionboolean. Whether to swap the function and its argument (i.e., reflect across y=x).
$p.labelPositiontext. Position of the curve's label relative to the curve.
$p.layerinteger. Z-order layer index used to stack graphical components (higher values render on top).
$p.numDiscretizationPointsnumber. Number of points used when discretizing the curve for rendering.
$p.parMaxnumber. Maximum value of the parabola's parameter.
$p.parMinnumber. Minimum value of the parabola's parameter.
$p.periodicboolean. Whether the curve is treated as periodic when interpolating between control points.
$p.showCoordsWhenDraggingboolean. Whether to show coordinate labels while dragging the curve.
$p.splineFormtext. Form of spline used to interpolate between control points.
$p.splineTensionnumber. Tension parameter used when fitting a spline through control points.
$p.styleDescriptiontext. A textual description of the curve's style.
$p.styleDescriptionWithNountext. Style description including the word "parabola".
$p.throughPoints[ math ]. Points the parabola passes through.
$p.vertex[ math ]. The vertex coordinates of the parabola.
Common to all components (4)
$p.doenetMLtext. The DoenetML source code that produced this component.
$p.hideboolean. Whether to hide this component from the rendered output.
$p.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$p.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Default <parabola>
The default <parabola> renders the graph of the equation . It is not draggable.
Example: <parabola> passing through 3 points
A <parabola> can be rendered when 3 throughPoints are specified with the through attribute.
Example: <parabola> with vertex and throughPoint
A <parabola> can be rendered by specifying the vertex and a single throughPoint.
Attribute Examples
Attribute Example: through
The through attribute specifies a point or points the parabola passes through.
Attribute Example: vertex
The vertex attribute specifies the maximum or minimum point on the parabola.
Attribute Example: flipFunction
The flipFunction attribute is used to define a quadratic function in .
Attribute Example: Standard graphical attributes
The uses of the following standard graphical attributes are illustrated: hide, layer, styleNumber, applyStyleToLabel and labelIsName.
Property Examples
Property Example: Style properties
The styleDescription and styleDescriptionWithNoun properties render a text description corresponding to the styleNumber of the component.
Property Example: a, b, c
The a, b and c properties return the coefficients of the parabola’s equation in general form.