float BasicFloatInterpolation::outInCircInterpolation(float startvalue, float endvalue, float time) { if (time < 0.f) return startvalue; if (time > 1.f) return endvalue; if (time < 0.5f) return outCircInterpolation(startvalue, (startvalue + endvalue) / 2.f, time * 2.f); else return inCircInterpolation((startvalue + endvalue) / 2.f, endvalue, time * 2.f - 1.f); }
int BasicIntInterpolation::inOutCircInterpolation(float startvalue, float endvalue, float time) { if (time < 0.f) return static_cast<int>(startvalue); if (time > 1.f) return static_cast<int>(endvalue); if (time < 0.5f) return inCircInterpolation(startvalue, (startvalue + endvalue) / 2.f, time * 2.f); else return outCircInterpolation((startvalue + endvalue) / 2.f, endvalue, time * 2.f - 1.f); }