本页内容

Utils::MathUtils Namespace

namespace Utils::MathUtils

包含用于插值的函数。更多...

Header: #include <MathUtils>

函数

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)

详细说明

函数文档

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

指数插值:

  • 当x = 0时,返回y1 。
  • 当x =xHalfLife 时,返回y1 与y2 之间距离的50%。
  • 当x =∞时,返回y2 。

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

线性插值:

  • 对于x =x1 ,其返回结果为y1 。
  • 当x =x2 时,返回y2 。

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

切线插值:

  • 当x = 0时,返回y1 。
  • 当x =xHalfLife 时,返回y1 与y2 之间距离的50%。
  • 当x =∞时,返回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.