ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: LIB/ANIM.CC

Source reference: LIB/ANIM.CC

Deterministic source record. The complete textual file is reproduced below; this page does not replace architectural interpretation in the authored chapters.

File identity

Field Value
Path LIB/ANIM.CC
Lines 24
Bytes 410
SHA-256 a4306cf648dafab4291ceba420423e44dd4d51b51d2158bd627b582636e43cc7
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
— No preprocessor include detected.

Detected symbols

Line Symbol
4 anim_lerp
8 anim_eval1

Complete source

The following block is the complete textual file at the recorded revision. No lines are elided, abbreviated or paraphrased.

#ifndef ANIM_CC_H
#define ANIM_CC_H

float anim_lerp(float a, float b, float u) {
    return a + (b - a) * u;
}

float anim_eval1(float t0, float v0, float t1, float v1, float t) {
    float u;
    float dt;
    dt = t1 - t0;
    if (dt < 0.001)
        u = 0.0;
    else
        u = (t - t0) / dt;
    if (u < 0.0)
        u = 0.0;
    if (u > 1.0)
        u = 1.0;
    return anim_lerp(v0, v1, u);
}

#endif

Role of this record

The atlas guarantees file-by-file traceability. Responsibility, invariants, ownership, concurrency, security, performance and subsystem interactions belong in authored chapters and must cite this file when applicable.

Document record ID: source-a4306cf648dafab4 Reviewed source: da3df29cb397 Class: generated-source-reference