Docs / Shaping functions

Glossary: QuadraticThroughAGivenPoint

The curve of QuadraticThroughAGivenPoint, its parameters and its constructor.

Color legend plain property method

The parabola through (0, 0), (A, B) and (1, 1), kept within 0 to 1.

A class in the category ShapingFunctionCategory.Quadratic. It derives from BaseShapingFunction and has its members too: CalculateOutput gives the curve. The parameters page shows it in context, with what its parameters do.

Names are colored by what they are: a property or a method; values and fields keep the plain color.

The curve

The curve of QuadraticThroughAGivenPoint for several settings of its parameters
A = 0.5, with B = 0.05, 0.2, 0.8 and 0.95. The parabolas of 0.05 and 0.95 would leave 0 to 1, and are held at 0 and at 1 instead.
Property Value
Id ShapingFunctionId.QuadraticThroughAGivenPoint, number 27
Category ShapingFunctionCategory.Quadratic
Name "Quadratic Through A Given Point"
Order 2
ParameterCount 2
HasVariableOrder false

For an input x from 0 to 1, the output is x − k·x(1 − x), with k = (A − B) / (A(1 − A)), clamped to 0 to 1.

Where the parabola would leave 0 to 1, the clamp holds it at 0 or 1: with A = 0.5 and B = 0.05 it stays at 0 until x = 0.44. With its defaults, A = 0.00001 and B = 0, it is QuadraticEaseIn to within 0.00001. It stays within 0 to 1 and never goes back.

Properties

A →

float · From IOneParameter. The x of the point the parabola passes through. Clamped to 0.00001 to 0.99999 when set, so the curve never divides by 0; 0.00001 by default. Throws ArgumentOutOfRangeException for NaN and keeps the value it had.

B →

float · From ITwoParameters. The y of that point. Clamped to 0 to 1 when set; 0 by default. Throws ArgumentOutOfRangeException for NaN and keeps the value it had.

Methods

QuadraticThroughAGivenPoint() →

QuadraticThroughAGivenPoint() · Creates the curve, with its parameters at their defaults. ShapingFunctionFactory.Create creates the same from ShapingFunctionId.QuadraticThroughAGivenPoint.