Referenceparabola

<parabola>

A parabola defined by formula or geometric parameters

<parabola> is a Graphical component that renders a parabola when nested inside a <graph> component.

Attributes and Properties

Attributes for <parabola>

Number display (5)
avoidScientificNotation

boolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.

displayDecimals

integer. Default value: 2. Number of decimal places to display when rendering this number.

displayDigits

integer. Default value: 3. Number of significant digits to display when rendering this number.

displaySmallAsZero

number. Default value: 1e-14. Threshold below which numbers are displayed as zero.

padZeros

boolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

Labels (1)
labelIsName

boolean. Default value: false. Whether to use this component's name as its rendered label.

Other (17)
applyStyleToLabel

boolean. Default value: false. Whether to apply this component's selected style to its label.

draggable

boolean. Default value: true. Whether the curve can be dragged on a graph.

extrapolateBackward

boolean. Default value: false. Whether to extrapolate the curve before its first defined point.

extrapolateForward

boolean. 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).

labelPosition

keyword. Position of the curve's label relative to the curve.

ValueDescription
upperRight (default)Place the label above and to the right of the curve.
upperLeftPlace the label above and to the left of the curve.
lowerRightPlace the label below and to the right of the curve.
lowerLeftPlace the label below and to the left of the curve.
topPlace the label directly above the curve.
bottomPlace the label directly below the curve.
leftPlace the label directly to the left of the curve.
rightPlace the label directly to the right of the curve.
layer

integer. Default value: 0. Z-order layer index used to stack graphical components (higher values render on top).

lineStyle

keyword. Stroke style for lines.

ValueDescription
solidContinuous, unbroken stroke.
dashedStroke composed of evenly-spaced dashes.
dottedStroke composed of evenly-spaced dots.
lineWidth

number. Stroke width for lines, in pixels.

nearestPointAsCurve

boolean. Default value: false. Whether nearest-point queries should treat this as a curve in the plane rather than a graph y = f(x).

numDiscretizationPoints

number. Default value: 1000. Number of points used when discretizing the curve for rendering.

periodic

boolean. Default value: false. Whether the curve is treated as periodic when interpolating between control points.

showCoordsWhenDragging

boolean. Default value: true. Whether to show coordinate labels while dragging the curve.

splineForm

keyword. Form of spline used to interpolate between control points.

ValueDescription
centripetal (default)Centripetal Catmull-Rom spline (avoids self-intersection at sharp turns).
uniformUniform Catmull-Rom spline with evenly spaced parameterization.
splineTension

number. 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)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. 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.avoidScientificNotation

boolean. Whether to render numbers in full decimal form rather than scientific notation.

$p.displayDecimals

integer. Number of decimal places to display when rendering this number.

$p.displayDigits

integer. Number of significant digits to display when rendering this number.

$p.displaySmallAsZero

number. Threshold below which numbers are displayed as zero.

$p.padZeros

boolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

Labels (2)
$p.label

label. The label rendered with this component.

$p.labelIsName

boolean. Whether to use this component's name as its rendered label.

Other (26)
$p.a

number. The leading coefficient of the parabola (in y = a x^2 + b x + c).

$p.applyStyleToLabel

boolean. Whether to apply this component's selected style to its label.

$p.b

number. The linear coefficient in y = a x^2 + b x + c.

$p.c

number. The constant term in y = a x^2 + b x + c.

$p.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$p.draggable

boolean. Whether the curve can be dragged on a graph.

$p.equation

math. The parabola's equation as a math expression.

$p.extrapolateBackward

boolean. Whether to extrapolate the curve before its first defined point.

$p.extrapolateForward

boolean. Whether to extrapolate the curve beyond its last defined point.

$p.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$p.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$p.flipFunction

boolean. Whether to swap the function and its argument (i.e., reflect across y=x).

$p.hidden

boolean. Whether this component is hidden from the rendered output.

$p.labelPosition

text. Position of the curve's label relative to the curve.

$p.layer

integer. Z-order layer index used to stack graphical components (higher values render on top).

$p.numDiscretizationPoints

number. Number of points used when discretizing the curve for rendering.

$p.parMax

number. Maximum value of the parabola's parameter.

$p.parMin

number. Minimum value of the parabola's parameter.

$p.periodic

boolean. Whether the curve is treated as periodic when interpolating between control points.

$p.showCoordsWhenDragging

boolean. Whether to show coordinate labels while dragging the curve.

$p.splineForm

text. Form of spline used to interpolate between control points.

$p.splineTension

number. Tension parameter used when fitting a spline through control points.

$p.styleDescription

text. A textual description of the curve's style.

$p.styleDescriptionWithNoun

text. 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.doenetML

text. The DoenetML source code that produced this component.

$p.hide

boolean. Whether to hide this component from the rendered output.

$p.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$p.styleNumber

integer. 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 y=x2y = x^2. 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 yy.


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.