<wrapFunctionPeriodic>
<wrapFunctionPeriodic> is a Math Operator
that wraps the output of a <function> into a periodic range
. Any output that falls outside that
range is shifted by a whole multiple of the range’s length until it lands
inside.
The result is itself a function and can be evaluated, graphed, or composed
just like any other <function>. Compare with
<wrapNumberPeriodic>, which wraps a single
number rather than a function, and with <clampFunction>,
which truncates outputs at the endpoints rather than wrapping them.
Attributes and Properties
Attributes for <wrapFunctionPeriodic>
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 (21)
applyStyleToLabelboolean. Default value: false. Whether to apply the function's style to its label.
domain[ intervalList ]. Restriction of the function's domain to a list of intervals.
expandboolean. Default value: false. Whether to expand the function's formula.
extrema[ extrema ]. Local extrema (combined minima and maxima) of an interpolated function.
labelPositionkeyword. Position of the function's label.
| Value | Description |
|---|---|
upperRight (default) | Place the label above and to the right of the function curve. |
upperLeft | Place the label above and to the left of the function curve. |
lowerRight | Place the label below and to the right of the function curve. |
lowerLeft | Place the label below and to the left of the function curve. |
top | Place the label directly above the function curve. |
bottom | Place the label directly below the function curve. |
left | Place the label directly to the left of the function curve. |
right | Place the label directly to the right of the function curve. |
layernumber. Default value: 0. Z-order layer index for stacking the function on a graph.
number. Default value: 0. Lower bound for the operator's range.
maxima[ extrema ]. Local maxima of an interpolated function.
minima[ extrema ]. Local minima of an interpolated function.
nearestPointAsCurveboolean. Default value: false. Whether nearest-point queries should treat the function as a curve in the plane rather than a graph y = f(x).
numInputsinteger. Number of input arguments the function accepts.
numOutputsinteger. Default value: 1. Number of output values the function produces.
simplifykeyword. Level of simplification applied to the function's formula.
| Value | Description |
|---|---|
none | No simplification is applied. |
full (default) | Fully simplify the function's formula. |
numbers | Simplify numeric subexpressions only, leaving symbolic structure intact. |
numbersPreserveOrder | Like numbers, but does not reorder commutative operands. |
normalizeOrder | Reorder commutative operands into a canonical form without simplifying values. |
symbolicboolean. Default value: true. Whether the function should be evaluated symbolically rather than numerically.
throughpointList. Points the interpolated function should pass through.
throughSlopesmathList. Slopes the interpolated function should have at each through-point.
number. Default value: 1. Upper bound for the operator's range.
variable_variableName. Name of the function's single input variable.
variables[ _variableNameList ]. Names of the function's input variables.
xscalenumber. Default value: 1. Scale factor used along the x-axis.
yscalenumber. Default value: 1. Scale factor used along the y-axis.
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 <wrapFunctionPeriodic name="w">
Number display (5)
$w.avoidScientificNotationboolean. Whether to render numbers in full decimal form rather than scientific notation.
$w.displayDecimalsinteger. Number of decimal places to display when rendering this number.
$w.displayDigitsinteger. Number of significant digits to display when rendering this number.
$w.displaySmallAsZeronumber. Threshold below which numbers are displayed as zero.
$w.padZerosboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Labels (2)
$w.labellabel. The label rendered with this component.
$w.labelIsNameboolean. Whether to use this component's name as its rendered label.
Other (44)
$w.applyStyleToLabelboolean. Whether to apply the function's style to its label.
$w.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
$w.disabledboolean. Whether this component is disabled and cannot be interacted with.
$w.domain[ interval ]. Domain interval(s) of the function.
$w.expandtext. Whether to expand the formula.
$w.expandSpecifiedboolean. Whether to expand the function's formula.
$w.extrema[ number ]. Local extrema (minima + maxima) of the function.
$w.extremumLocations[ number ]. The x-coordinates of the function's local extrema.
$w.extremumValues[ number ]. The values of the function's local extrema.
$w.fixedboolean. Whether this component's value is fixed and cannot be modified.
$w.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$w.formulamath. The symbolic formula of the function produced by this operator.
$w.globalInfimum[ number ]. The global infimum of the function.
$w.globalMaximum[ number ]. The global maximum of the function (if attained).
$w.globalMinimum[ number ]. The global minimum of the function (if attained).
$w.globalSupremum[ number ]. The global supremum of the function.
$w.labelPositiontext. Position of the function's label.
$w.latexlatex. The function rendered as a LaTeX string.
$w.layernumber. Z-order layer index for stacking the function on a graph.
$w.lowerValuenumber. Lower bound for the operator's range.
$w.maxima[ number ]. Local maxima of the function.
$w.maximumLocations[ number ]. The x-coordinates of the function's local maxima.
$w.maximumValues[ number ]. The values of the function's local maxima.
$w.minima[ number ]. Local minima of the function.
$w.minimumLocations[ number ]. The x-coordinates of the function's local minima.
$w.minimumValues[ number ]. The values of the function's local minima.
$w.numExtremanumber. Number of local extrema (minima + maxima) of the function.
$w.numInputsinteger. Number of input variables of the function.
$w.numMaximanumber. Number of local maxima of the function.
$w.numMinimanumber. Number of local minima of the function.
$w.numOutputsinteger. Number of output values of the function.
$w.simplifytext. Level of simplification applied when displaying the formula.
$w.styleDescriptiontext. A textual description of the function's style.
$w.styleDescriptionWithNountext. Style description including the word "function".
$w.symbolicboolean. Whether the function is treated symbolically.
$w.texttext. The function rendered as a plain text string.
$w.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$w.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
$w.upperValuenumber. Upper bound for the operator's range.
$w.variable_variableName. The function's first input variable name.
$w.variables[ _variableName ]. The names of the function's input variables.
$w.xscalenumber. Scale factor used along the x-axis.
$w.yscalenumber. Scale factor used along the y-axis.
Common to all components (4)
$w.doenetMLtext. The DoenetML source code that produced this component.
$w.hideboolean. Whether to hide this component from the rendered output.
$w.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$w.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Wrap a linear function to
The underlying function f(x) = x/4 is plotted alongside its periodic wrap.
Each time the line would leave , the wrap brings it back to the
other side, producing the sawtooth pattern.
Example: Evaluate a periodically-wrapped function
For an input that already lies in the wrap is a no-op; for an input outside the range the function returns the equivalent value inside the range.
Attribute Examples
Attribute Example: lowerValue, upperValue
lowerValue and upperValue set the periodic range. The wrapped function
takes values in — outputs above are reduced by until they
fall inside, and outputs below are increased by until they do.