rate-functions.dhover×156all
#!/usr/bin/env dub
/+ dub.sdl:
    name "manim_rate_functions"
    targetPath "build"
+/
/**
 * Rate functions (easing) — the reshaping every `Animation` applies to its
 * `[0,1]` time parameter before interpolation, plus the `lag_ratio`
 * staggering that spreads a group of sub-animations across the window.
 *
 * The *animation & timing* axis of the analysis spine, exercised in code.
 * A Manim `Animation` maps wall-clock progress `alpha ∈ [0,1]` through a
 * `rate_func` and then lerps the mobject; composition (`AnimationGroup`,
 * `LaggedStart`) additionally offsets each submobject by `lag_ratio` so they
 * start in sequence. This probe reimplements the community rate functions and
 * the `get_sub_alpha` stagger formula so the timing model is grounded in
 * runnable numbers rather than prose:
 *
 *   - `linear(t)   = t`
 *   - `smootherstep(t) = 6t⁵ − 15t⁴ + 10t³`  (zero 1st AND 2nd derivative at
 *                    both ends). NOTE the fork divergence: this quintic is
 *                    ManimGL's default `smooth` (rate_functions.py — "Equivalent
 *                    to bezier([0,0,0,1,1,1])"), but Manim **community**'s default
 *                    `smooth` is instead a normalized logistic **sigmoid**
 *                    (`inflection = 10`), and it keeps the quintic under the
 *                    separate name `smootherstep`. Both are ease-in-out S-curves;
 *                    this probe prints both so the divergence is visible.
 *   - `smoothSigmoid(t)` — community's default `smooth`: a logistic sigmoid
 *                    rescaled to hit exactly 0 and 1 at the endpoints.
 *   - `rush_into(t)= 2·smootherstep(t/2)`      (ease-in only)
 *   - `rush_from(t)= 2·smootherstep(t/2 + ½) − 1` (ease-out only)
 *   - `there_and_back(t)` — out to 1 at t=½, back to 0 at t=1
 *   - the `lag_ratio` sub-window map:
 *        full = (n−1)·lag + 1;  sub_alpha_i = alpha·full − i·lag
 *     (Manim clamps this to `[0,1]` one call deeper, inside the `unit_interval`
 *     decorator wrapping each rate function; this probe clamps it directly.)
 *
 * The eased tables and the stagger matrix here are the evidence behind
 * `concepts.md` § easing / § lag_ratio and the `manim-community/index.md`
 * timing section.
 *
 * Companion to docs/research/manim/concepts.md § "Rate function / easing"
 *   and § "lag_ratio / stagger".
 * Run with: dub run --single rate-functions.d
 *
 * Portability: pure computation, no external dependencies — runs everywhere.
 */
module 
(module) manim_rate_functions

Rate functions (easing) — the reshaping every Animation applies to its [0,1] time parameter before interpolation, plus the lag_ratio staggering that spreads a group of sub-animations across the window.

The animation & timing axis of the analysis spine, exercised in code. A Manim Animation maps wall-clock progress alpha ∈ [0,1] through a rate_func and then lerps the mobject; composition (AnimationGroup, LaggedStart) additionally offsets each submobject by lag_ratio so they start in sequence. This probe reimplements the community rate functions and the get_sub_alpha stagger formula so the timing model is grounded in runnable numbers rather than prose:

  • linear(t) = t

  • smootherstep(t) = 6t⁵ − 15t⁴ + 10t³ (zero 1st AND 2nd derivative at both ends). NOTE the fork divergence: this quintic is ManimGL's default smooth (rate_functions.py — "Equivalent to bezier(0,0,0,1,1,1)"), but Manim community's default smooth is instead a normalized logistic sigmoid (inflection = 10), and it keeps the quintic under the separate name smootherstep. Both are ease-in-out S-curves; this probe prints both so the divergence is visible.

  • smoothSigmoid(t) — community's default smooth: a logistic sigmoid rescaled to hit exactly 0 and 1 at the endpoints.

  • rush_into(t)= 2·smootherstep(t/2) (ease-in only)

  • rush_from(t)= 2·smootherstep(t/2 + ½) − 1 (ease-out only)

  • there_and_back(t) — out to 1 at t=½, back to 0 at t=1

  • the lag_ratio sub-window map: full = (n−1)·lag + 1; sub_alpha_i = alpha·full − i·lag (Manim clamps this to [0,1] one call deeper, inside the unit_interval decorator wrapping each rate function; this probe clamps it directly.)

The eased tables and the stagger matrix here are the evidence behind concepts.md § easing / § lag_ratio and the manim-community/index.md timing section.

Companion to docs/research/manim/concepts.md § "Rate function / easing" and § "lag_ratio / stagger". Run with: dub run --single rate-functions.d

Portability

pure computation, no external dependencies — runs everywhere.

manim_rate_functions
;
import
(package) std
std
.
(module) std.algorithm

This package implements generic algorithms oriented towards the processing of sequences. Sequences processed by these functions define range-based interfaces. See also Reference on ranges and tutorial on ranges.

Algorithms are categorized into the following submodules:

Submodule Functions

| Searching | all any balancedParens boyerMooreFinder canFind commonPrefix count countUntil endsWith find findAdjacent findAmong findSkip findSplit findSplitAfter findSplitBefore minCount maxCount minElement maxElement minIndex maxIndex minPos maxPos skipOver startsWith until |

| Comparison | among castSwitch clamp cmp either equal isPermutation isSameLength levenshteinDistance levenshteinDistanceAndPath max min mismatch predSwitch |

| Iteration | cache cacheBidirectional chunkBy cumulativeFold each filter filterBidirectional fold group joiner map mean permutations reduce splitWhen splitter substitute sum uniq |

| Sorting | completeSort isPartitioned isSorted isStrictlyMonotonic ordered strictlyOrdered makeIndex merge multiSort nextEvenPermutation nextPermutation nthPermutation partialSort partition partition3 schwartzSort sort topN topNCopy topNIndex |

| Set operations (setops) | cartesianProduct largestPartialIntersection largestPartialIntersectionWeighted multiwayMerge multiwayUnion setDifference setIntersection setSymmetricDifference |

| Mutation | bringToFront copy fill initializeAll move moveAll moveSome moveEmplace moveEmplaceAll moveEmplaceSome remove reverse strip stripLeft stripRight swap swapRanges uninitializedFill |

Many functions in this package are parameterized with a predicate. The predicate may be any suitable callable type (a function, a delegate, a functor, or a lambda), or a compile-time string. The string may consist of any legal D expression that uses the symbol a (for unary functions) or the symbols a and b (for binary functions). These names will NOT interfere with other homonym symbols in user code because they are evaluated in a different context. The default for all binary comparison predicates is "a == b" for unordered operations and "a < b" for ordered operations.

Example

int[] a = ...;
static bool greater(int a, int b)
{
    return a > b;
}
sort!greater(a);           // predicate as alias
sort!((a, b) => a > b)(a); // predicate as a lambda.
sort!"a > b"(a);           // predicate as string
                           // (no ambiguity with array name)
sort(a);                   // no predicate, "a < b" is implicit

Source

std/algorithm/package.d

@copyrightAndrei Alexandrescu 2008-.@licenseBoost License 1.0.@authorsAndrei Alexandrescu
algorithm
:
(alias template) manim_rate_functions.clamp = std.algorithm.comparison.clamp(T1, T2, T3)(T1 val, T2 lower, T3 upper)

Clamps val into the given bounds. Result has the same type as val.

@paramval The value to clamp.@paramlower The lower bound of the clamp.@paramupper The upper bound of the clamp.@returnslower if val is less than lower, upper if val is greater than upper, and val in all other cases. Comparisons are made correctly (using lessThan and the return value is converted to the return type using the standard integer coversion rules greaterThan) even if the signedness of T1, T2, and T3 are different.
clamp
;
import
(package) std
std
.
(module) std.math

Contains the elementary mathematical functions (powers, roots, and trigonometric functions), and low-level floating-point operations. Mathematical special functions are available in std.mathspecial.

Category Members
Constants E PI PI_2 PI4 M1_PI M2_PI M2_SQRTPI LN10 LN2 LOG2 LOG2E LOG2T LOG10E SQRT2 SQRT1_2
Algebraic abs fabs sqrt cbrt hypot poly nextPow2 truncPow2
Trigonometry sin cos tan asin acos atan atan2 sinh cosh tanh asinh acosh atanh
Rounding ceil floor round lround trunc rint lrint nearbyint rndtol quantize
Exponentiation & Logarithms pow powmod exp exp2 expm1 ldexp frexp log log2 log10 logb ilogb log1p scalbn
Remainder fmod modf remainder remquo
Floating-point operations approxEqual feqrel fdim fmax fmin fma isClose nextDown nextUp nextafter NaN getNaNPayload cmp
Introspection isFinite isIdentical isInfinity isNaN isNormal isSubnormal signbit sgn copysign isPowerOf2
Hardware Control IeeeFlags ieeeFlags resetIeeeFlags FloatingPointControl

The functionality closely follows the IEEE754-2008 standard for floating-point arithmetic, including the use of camelCase names rather than C99-style lower case names. All of these functions behave correctly when presented with an infinity or NaN.

The following IEEE 'real' formats are currently supported:

  • 64 bit Big-endian 'double' (eg PowerPC)

  • 128 bit Big-endian 'quadruple' (eg SPARC)

  • 64 bit Little-endian 'double' (eg x86-SSE2)

  • 80 bit Little-endian, with implied bit 'real80' (eg x87, Itanium)

  • 128 bit Little-endian 'quadruple' (not implemented on any known processor!)

  • Non-IEEE 128 bit Big-endian 'doubledouble' (eg PowerPC) has partial support

Unlike C, there is no global 'errno' variable. Consequently, almost all of these functions are pure nothrow.

Source

std/math/package.d

@copyrightCopyright The D Language Foundation 2000 - 2011. D implementations of tan, atan, atan2, exp, expm1, exp2, log, log10, log1p, log2, floor, ceil and lrint functions are based on the CEPHES math library, which is Copyright (C) 2001 Stephen L. Moshier <steve@moshier.net> and are incorporated herein by permission of the author. The author reserves the right to distribute this material elsewhere under different copying permissions. These modifications are distributed here under the following terms:@licenseBoost License 1.0.@authorsWalter Bright, Don Clugston, Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger
math
:
(alias) manim_rate_functions.exp = real std.math.exponential.exp(real x) pure nothrow @nogc @trusted

Calculates ex.

x ex
+ +
- +0.0
exp
;
import
(package) std
std
.
(module) std.stdio
Category Symbols
File handles _popen File isFileHandle openNetwork stderr stdin stdout
Reading chunks lines readf readfln readln
Writing toFile write writef writefln writeln
Misc KeepTerminator LockType StdioException

Standard I/O functions that extend core.stdc.stdio. core.stdc.stdio is publically imported when importing std.stdio.

There are three layers of I/O:

  1. The lowest layer is the operating system layer. The two main schemes are Windows and Posix.

  2. C's stdio.h which unifies the two operating system schemes.

  3. std.stdio, this module, unifies the various stdio.h implementations into a high level package for D programs.

Source

std/stdio.d

@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Alex Rønne Petersen
stdio
:
(alias template) manim_rate_functions.write = std.stdio.write(T...)(T args) if (!is(T[0] : File))

Writes its arguments in text format to standard output (without a trailing newline).

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         write("Input ", count, ": ", line, "\n");
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
write
,
(alias template) manim_rate_functions.writefln = std.stdio.writefln(alias fmt, A...)(A args) if (isSomeString!(typeof(fmt)))

Equivalent to writef(fmt, args, '\n').

writefln
,
(alias template) manim_rate_functions.writeln = std.stdio.writeln(T...)(T args)

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
;
/// The smootherstep quintic — ManimGL's default `smooth`, community's `smootherstep`. double
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
(double
(parameter) double t
t
) @safe pure nothrow @nogc
{ // 6t^5 - 15t^4 + 10t^3 return
(parameter) double t
t
*
(parameter) double t
t
*
(parameter) double t
t
* (
(parameter) double t
t
* (
(parameter) double t
t
* 6 - 15) + 10);
} /// Community's default `smooth`: a logistic sigmoid rescaled to [0,1] on [0,1]. double
double manim_rate_functions.smoothSigmoid(double t, double inflection = 10.0) pure nothrow @nogc @safe

Community's default smooth: a logistic sigmoid rescaled to 0,1 on 0,1.

smoothSigmoid
(double
(parameter) double t
t
, double
(parameter) double inflection
inflection
= 10.0) @safe pure nothrow @nogc
{ double
double manim_rate_functions.smoothSigmoid.sig(double x) pure nothrow @nogc @safe
sig
(double
(parameter) double x
x
) => 1.0 / (1.0 +
double std.math.exponential.exp(double x) pure nothrow @nogc @safe

Calculates ex.

x ex
+ +
- +0.0
exp
(-
(parameter) double x
x
));
const
(local variable) const(double) err
err
=
double manim_rate_functions.smoothSigmoid.sig(double x) pure nothrow @nogc @safe
sig
(-
(parameter) double inflection
inflection
* 0.5); // value at t=0, subtracted off
return
double std.algorithm.comparison.clamp!(double, double, double)(double val, double lower, double upper) pure nothrow @nogc @safe

Clamps val into the given bounds. Result has the same type as val.

Examples

assert(clamp(2, 1, 3) == 2);
assert(clamp(0, 1, 3) == 1);
assert(clamp(4, 1, 3) == 3);

assert(clamp(1, 1, 1) == 1);

assert(clamp(5, -1, 2u) == 2);

auto x = clamp(42, uint.max, uint.max);
static assert(is(typeof(x) == int));
assert(x == -1);
@paramval The value to clamp.@paramlower The lower bound of the clamp.@paramupper The upper bound of the clamp.@returnslower if val is less than lower, upper if val is greater than upper, and val in all other cases. Comparisons are made correctly (using lessThan and the return value is converted to the return type using the standard integer coversion rules greaterThan) even if the signedness of T1, T2, and T3 are different.
clamp
((
double manim_rate_functions.smoothSigmoid.sig(double x) pure nothrow @nogc @safe
sig
(
(parameter) double inflection
inflection
* (
(parameter) double t
t
- 0.5)) -
(local variable) const(double) err
err
) / (1 - 2 *
(local variable) const(double) err
err
), 0.0, 1.0);
} double
double manim_rate_functions.linear(double t) pure nothrow @nogc @safe
linear
(double
(parameter) double t
t
) @safe pure nothrow @nogc =>
(parameter) double t
t
;
double
double manim_rate_functions.rushInto(double t) pure nothrow @nogc @safe
rushInto
(double
(parameter) double t
t
) @safe pure nothrow @nogc => 2 *
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
(
(parameter) double t
t
/ 2);
double
double manim_rate_functions.rushFrom(double t) pure nothrow @nogc @safe
rushFrom
(double
(parameter) double t
t
) @safe pure nothrow @nogc => 2 *
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
(
(parameter) double t
t
/ 2 + 0.5) - 1;
double
double manim_rate_functions.thereAndBack(double t) pure nothrow @nogc @safe
thereAndBack
(double
(parameter) double t
t
) @safe pure nothrow @nogc
=>
(parameter) double t
t
< 0.5 ?
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
(2 *
(parameter) double t
t
) :
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
(2 * (1 -
(parameter) double t
t
));
/// Manim's `get_sub_alpha`: submobject `i` of `n` under a given `lag_ratio`. double
double manim_rate_functions.subAlpha(double alpha, ulong i, ulong n, double lag) pure nothrow @nogc @safe

Manim's get_sub_alpha: submobject i of n under a given lag_ratio.

subAlpha
(double
(parameter) double alpha
alpha
,
(alias) object.size_t = ulong
size_t
(parameter) ulong i
i
,
(alias) object.size_t = ulong
size_t
(parameter) ulong n
n
, double
(parameter) double lag
lag
) @safe pure nothrow @nogc
{ const
(local variable) const(double) full
full
= (
(parameter) ulong n
n
- 1) *
(parameter) double lag
lag
+ 1;
return
double std.algorithm.comparison.clamp!(double, double, double)(double val, double lower, double upper) pure nothrow @nogc @safe

Clamps val into the given bounds. Result has the same type as val.

Examples

assert(clamp(2, 1, 3) == 2);
assert(clamp(0, 1, 3) == 1);
assert(clamp(4, 1, 3) == 3);

assert(clamp(1, 1, 1) == 1);

assert(clamp(5, -1, 2u) == 2);

auto x = clamp(42, uint.max, uint.max);
static assert(is(typeof(x) == int));
assert(x == -1);
@paramval The value to clamp.@paramlower The lower bound of the clamp.@paramupper The upper bound of the clamp.@returnslower if val is less than lower, upper if val is greater than upper, and val in all other cases. Comparisons are made correctly (using lessThan and the return value is converted to the return type using the standard integer coversion rules greaterThan) even if the signedness of T1, T2, and T3 are different.
clamp
(
(parameter) double alpha
alpha
*
(local variable) const(double) full
full
-
(parameter) ulong i
i
*
(parameter) double lag
lag
, 0.0, 1.0);
} int
int D main() @safe
main
() @safe
{ alias
(alias) manim_rate_functions.main.Fn = double function(double) pure nothrow @nogc @safe
Fn
= double function(double) @safe pure nothrow @nogc;
const
(alias) manim_rate_functions.main.Fn = double function(double) pure nothrow @nogc @safe
Fn
[5]
(local variable) const(double function(double) pure nothrow @nogc @safe[5]) fns
fns
= [&
double manim_rate_functions.linear(double t) pure nothrow @nogc @safe
linear
, &
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
, &
double manim_rate_functions.rushInto(double t) pure nothrow @nogc @safe
rushInto
, &
double manim_rate_functions.rushFrom(double t) pure nothrow @nogc @safe
rushFrom
, &
double manim_rate_functions.thereAndBack(double t) pure nothrow @nogc @safe
thereAndBack
];
immutable
(alias) object.string = string
string
[5]
(local variable) immutable(string[5]) names
names
= ["linear", "smoother", "rushInto", "rushFrom", "there&back"];
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("== rate functions over t in [0, 1] ==");
void std.stdio.writefln!(char, string, string, string, string, string)(in char[] fmt, string __param_1, string __param_2, string __param_3, string __param_4, string __param_5) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" t %-9s %-9s %-9s %-9s %-9s",
(local variable) immutable(string[5]) names
names
[0],
(local variable) immutable(string[5]) names
names
[1],
(local variable) immutable(string[5]) names
names
[2],
(local variable) immutable(string[5]) names
names
[3],
(local variable) immutable(string[5]) names
names
[4]);
foreach (
(local variable) int i
i
; 0 .. 11)
{ const
(local variable) const(double) t
t
=
(local variable) int i
i
/ 10.0;
void std.stdio.writefln!(char, const(double), double, double, double, double, double)(in char[] fmt, const(double) __param_1, double __param_2, double __param_3, double __param_4, double __param_5, double __param_6) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" %4.1f %8.4f %8.4f %8.4f %8.4f %8.4f",
(local variable) const(double) t
t
,
(local variable) const(double function(double) pure nothrow @nogc @safe[5]) fns
fns
[0](
(local variable) const(double) t
t
),
(local variable) const(double function(double) pure nothrow @nogc @safe[5]) fns
fns
[1](
(local variable) const(double) t
t
),
(local variable) const(double function(double) pure nothrow @nogc @safe[5]) fns
fns
[2](
(local variable) const(double) t
t
),
(local variable) const(double function(double) pure nothrow @nogc @safe[5]) fns
fns
[3](
(local variable) const(double) t
t
),
(local variable) const(double function(double) pure nothrow @nogc @safe[5]) fns
fns
[4](
(local variable) const(double) t
t
));
}
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\n== fork divergence: ManimGL/community `smootherstep` vs community default `smooth` (sigmoid) ==");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" t smootherstep smooth (sigmoid) |Δ|");
foreach (
(local variable) int i
i
; 0 .. 11)
{ const
(local variable) const(double) t
t
=
(local variable) int i
i
/ 10.0;
const
(local variable) const(double) a
a
=
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
(
(local variable) const(double) t
t
),
(local variable) const(double) b
b
=
double manim_rate_functions.smoothSigmoid(double t, double inflection = 10.0) pure nothrow @nogc @safe

Community's default smooth: a logistic sigmoid rescaled to 0,1 on 0,1.

smoothSigmoid
(
(local variable) const(double) t
t
);
void std.stdio.writefln!(char, const(double), const(double), const(double), const(double))(in char[] fmt, const(double) __param_1, const(double) __param_2, const(double) __param_3, const(double) __param_4) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" %4.1f %8.4f %8.4f %6.4f",
(local variable) const(double) t
t
,
(local variable) const(double) a
a
,
(local variable) const(double) b
b
,
(local variable) const(double) a
a
>
(local variable) const(double) b
b
?
(local variable) const(double) a
a
-
(local variable) const(double) b
b
:
(local variable) const(double) b
b
-
(local variable) const(double) a
a
);
}
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\n== smootherstep(t) as an ASCII curve (x = t, height = eased value) ==");
foreach_reverse (
(local variable) int row
row
; 0 .. 11)
{ const
(local variable) const(double) level
level
=
(local variable) int row
row
/ 10.0;
void std.stdio.write!string(string __param_0) @safe

Writes its arguments in text format to standard output (without a trailing newline).

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         write("Input ", count, ": ", line, "\n");
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
write
(" ");
foreach (
(local variable) int col
col
; 0 .. 41)
{ const
(local variable) const(double) t
t
=
(local variable) int col
col
/ 40.0;
void std.stdio.write!char(char __param_0) @safe

Writes its arguments in text format to standard output (without a trailing newline).

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         write("Input ", count, ": ", line, "\n");
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
write
(
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
(
(local variable) const(double) t
t
) >=
(local variable) const(double) level
level
- 0.05 &&
double manim_rate_functions.smootherstep(double t) pure nothrow @nogc @safe

The smootherstep quintic — ManimGL's default smooth, community's smootherstep.

smootherstep
(
(local variable) const(double) t
t
) <=
(local variable) const(double) level
level
+ 0.05 ? '*' : ' ');
}
void std.stdio.writefln!(char, const(double))(in char[] fmt, const(double) __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" %.1f",
(local variable) const(double) level
level
);
}
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" " ~ "----------------------------------------- t");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\n== lag_ratio stagger: sub_alpha for 4 submobjects, lag_ratio 0.5 ==");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" alpha sub0 sub1 sub2 sub3");
foreach (
(local variable) int i
i
; 0 .. 11)
{ const
(local variable) const(double) alpha
alpha
=
(local variable) int i
i
/ 10.0;
void std.stdio.writefln!(char, const(double), double, double, double, double)(in char[] fmt, const(double) __param_1, double __param_2, double __param_3, double __param_4, double __param_5) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" %4.1f %6.3f %6.3f %6.3f %6.3f",
(local variable) const(double) alpha
alpha
,
double manim_rate_functions.subAlpha(double alpha, ulong i, ulong n, double lag) pure nothrow @nogc @safe

Manim's get_sub_alpha: submobject i of n under a given lag_ratio.

subAlpha
(
(local variable) const(double) alpha
alpha
, 0, 4, 0.5),
double manim_rate_functions.subAlpha(double alpha, ulong i, ulong n, double lag) pure nothrow @nogc @safe

Manim's get_sub_alpha: submobject i of n under a given lag_ratio.

subAlpha
(
(local variable) const(double) alpha
alpha
, 1, 4, 0.5),
double manim_rate_functions.subAlpha(double alpha, ulong i, ulong n, double lag) pure nothrow @nogc @safe

Manim's get_sub_alpha: submobject i of n under a given lag_ratio.

subAlpha
(
(local variable) const(double) alpha
alpha
, 2, 4, 0.5),
double manim_rate_functions.subAlpha(double alpha, ulong i, ulong n, double lag) pure nothrow @nogc @safe

Manim's get_sub_alpha: submobject i of n under a given lag_ratio.

subAlpha
(
(local variable) const(double) alpha
alpha
, 3, 4, 0.5));
}
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" (lag_ratio 0 = all together; 1 = strict succession; 0.5 = overlap)");
return 0; }