On this page

Utils::MathUtils Namespace

namespace Utils::MathUtils

Contains functions for interpolation. More...

Header: #include <mathutils.h>

Functions

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

Detailed Description

Function Documentation

Utils::Q_DECL_IMPORT 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.

Utils::Q_DECL_IMPORT 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.

Utils::Q_DECL_IMPORT 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.

Copyright © The Qt Company Ltd. and other contributors. 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.