MathUtils Namespace

Utils::MathUtils

Contains functions for interpolation. More...

Header: #include <MathUtils>

Functions

int interpolateExponential(int x, int xHalfLife, int y1, int y2)
int interpolateLinear(int x, int x1, int x2, int y1, int y2)
int interpolateTangential(int x, int xHalfLife, int y1, int y2)

Detailed Description

Function Documentation

int MathUtils::interpolateExponential(int x, int xHalfLife, int y1, int y2)

Exponential interpolation:

  • For x = 0 it returns y1.
  • For x = xHalfLife it returns 50 % of the distance between y1 and y2.
  • For x = infinity it returns y2.

int MathUtils::interpolateLinear(int x, int x1, int x2, int y1, int y2)

Linear interpolation:

  • For x = x1 it returns y1.
  • For x = x2 it returns y2.

int MathUtils::interpolateTangential(int x, int xHalfLife, int y1, int y2)

Tangential interpolation:

  • For x = 0 it returns y1.
  • For x = xHalfLife it returns 50 % of the distance between y1 and y2.
  • For x = infinity it returns y2.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.