Skip to content

Commit 4a0d756

Browse files
committed
Add scale_cubic-bezier function
refs #10928
1 parent 5b0a9ea commit 4a0d756

File tree

1 file changed

+33
-0
lines changed
  • docs/user_manual/expressions/expression_help

1 file changed

+33
-0
lines changed

docs/user_manual/expressions/expression_help/Math.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,39 @@ Rounds a number to number of decimal places. The rounding is done to the nearest
459459

460460
.. end_round_section
461461
462+
.. _expression_function_Math_scale_cubic_bezier:
463+
464+
scale_cubic_bezier
465+
..................
466+
467+
Transforms a given value from an input domain to an output range using a cubic Bézier curve. This function can be used to ease values in or out of the specified output range using custom control points.
468+
469+
.. list-table::
470+
:widths: 15 85
471+
472+
* - Syntax
473+
- scale_cubic_bezier(value, domain_min, domain_max, range_min, range_max, x1, y1, x2, y2)
474+
* - Arguments
475+
- * **value** - A value in the input domain. The function will return a corresponding scaled value in the output range.
476+
* **domain_min** - Specifies the minimum value in the input domain, the smallest value the input value should take.
477+
* **domain_max** - Specifies the maximum value in the input domain, the largest value the input value should take.
478+
* **range_min** - Specifies the minimum value in the output range, the smallest value which should be output by the function.
479+
* **range_max** - Specifies the maximum value in the output range, the largest value which should be output by the function.
480+
* **x1** - The x-coordinate of the first control point. Must be a value between 0 and 1.
481+
* **y1** - The y-coordinate of the first control point. Must be a value between 0 and 1.
482+
* **x2** - The x-coordinate of the second control point. Must be a value between 0 and 1.
483+
* **y2** - The y-coordinate of the second control point. Must be a value between 0 and 1.
484+
* - Examples
485+
- * ``scale_cubic_bezier(5, 0, 10, 0, 100, 0.42, 0.0, 0.58, 1.0)`` → 50.0
486+
487+
easing in and out using a symmetrical cubic Bézier curve
488+
* ``scale_cubic_bezier(5, 0, 10, 0, 100, 0.25, 0.1, 0.25, 1.0)`` → 80.24034
489+
490+
a standard ease curve, accelerating quickly before decelerating gradually
491+
492+
493+
.. end_scale_cubic_bezier_section
494+
462495
.. _expression_function_Math_scale_exponential:
463496

464497
scale_exponential

0 commit comments

Comments
 (0)