CBlueUI  
C++ 跨平台跨框架的数据可视化工具
载入中...
搜索中...
未找到
UtilsMath 命名空间参考

函数

UI_EXP void LinearFit (VecFloat2 *points, int len, double &k, double &b)
 线性拟合-最小二乘法。拟合结果为 y= k * x + b
 
UI_EXP void LinearFitExp (VecFloat2 *points, int len, double &a, double &b)
 非线性拟合指数函数-最小二乘法。拟合结果为 y= a * b^x
 
UI_EXP void LinearFitPower (VecFloat2 *points, int len, double &a, double &b)
 非线性拟合幂函数-最小二乘法。拟合结果为 y= a * x^b
 
UI_EXP double InterpolationLagrange (VecFloat2 *points, int len, double xp)
 拉格朗日插值,求任意点xp的Y坐标
 
UI_EXP BOOL PtInLine (POINT pt, POINT p1, POINT p2, int nWeight)
 判断点是否在线段上
 
UI_EXP BOOL PtInRegion (POINT pt, std::vector< POINT > &points)
 判断点是否在points点围成的区域内
 
UI_EXP BOOL PtInRegion (POINT pt, const POINT points[], int nlen)
 
UI_EXP BOOL LineCrossPoint (POINT line1_p1, POINT line1_p2, POINT line2_p1, POINT line2_p2, POINT &ptCross)
 线段在各自延长线上存在交点
 
UI_EXP BOOL LineCrossPointInside (POINT line1_p1, POINT line1_p2, POINT line2_p1, POINT line2_p2, POINT &ptCross)
 线段上的交点,不包括各自延长线
 
UI_EXP void RectLayoutCalculator (LayoutPosition *objs, int len, RECT rcBox, UINT align, BOOL bHorz, int interval, BOOL bReverse)
 根据尺寸列表,计算在区域中的位置
 
UI_EXP void TrianglePoint (POINT pt[], RECT rect, int dir, int size)
 三角形顶点源
 
UI_EXP BOOL IsSameSign (double v1, double v2)
 同号
 
UI_EXP double VectorAngle (double x1, double y1, double x2, double y2)
 向量基于x轴的夹角
 

函数说明

◆ InterpolationLagrange()

UI_EXP double UtilsMath::InterpolationLagrange ( VecFloat2 points,
int  len,
double  xp 
)

拉格朗日插值,求任意点xp的Y坐标

参数
point输入点
len输入点个数
xp任意点X

◆ IsSameSign()

UI_EXP BOOL UtilsMath::IsSameSign ( double  v1,
double  v2 
)

同号

◆ LinearFit()

UI_EXP void UtilsMath::LinearFit ( VecFloat2 points,
int  len,
double &  k,
double &  b 
)

线性拟合-最小二乘法。拟合结果为 y= k * x + b

参数
point输入点
len输入点个数
k直线斜率
b直线截距

◆ LinearFitExp()

UI_EXP void UtilsMath::LinearFitExp ( VecFloat2 points,
int  len,
double &  a,
double &  b 
)

非线性拟合指数函数-最小二乘法。拟合结果为 y= a * b^x

参数
point输入点
len输入点个数
k直线斜率
b直线截距

◆ LinearFitPower()

UI_EXP void UtilsMath::LinearFitPower ( VecFloat2 points,
int  len,
double &  a,
double &  b 
)

非线性拟合幂函数-最小二乘法。拟合结果为 y= a * x^b

参数
point输入点
len输入点个数
k直线斜率
b直线截距

◆ LineCrossPoint()

UI_EXP BOOL UtilsMath::LineCrossPoint ( POINT  line1_p1,
POINT  line1_p2,
POINT  line2_p1,
POINT  line2_p2,
POINT ptCross 
)

线段在各自延长线上存在交点

◆ LineCrossPointInside()

UI_EXP BOOL UtilsMath::LineCrossPointInside ( POINT  line1_p1,
POINT  line1_p2,
POINT  line2_p1,
POINT  line2_p2,
POINT ptCross 
)

线段上的交点,不包括各自延长线

◆ PtInLine()

UI_EXP BOOL UtilsMath::PtInLine ( POINT  pt,
POINT  p1,
POINT  p2,
int  nWeight 
)

判断点是否在线段上

参数
pt测试点
p1线段起点
p2线段终点
nWeight线宽
返回
BOOL TRUE 在线段上

◆ PtInRegion() [1/2]

UI_EXP BOOL UtilsMath::PtInRegion ( POINT  pt,
const POINT  points[],
int  nlen 
)

◆ PtInRegion() [2/2]

UI_EXP BOOL UtilsMath::PtInRegion ( POINT  pt,
std::vector< POINT > &  points 
)

判断点是否在points点围成的区域内

◆ RectLayoutCalculator()

UI_EXP void UtilsMath::RectLayoutCalculator ( LayoutPosition objs,
int  len,
RECT  rcBox,
UINT  align,
BOOL  bHorz,
int  interval,
BOOL  bReverse 
)

根据尺寸列表,计算在区域中的位置

参数
objs元素数组
len个数
rcBox显示区域
align对齐方式
bHorz水平布局 Or 垂直布局
interval元素之间的间距
bReverse正向 Or 反向

◆ TrianglePoint()

UI_EXP void UtilsMath::TrianglePoint ( POINT  pt[],
RECT  rect,
int  dir,
int  size 
)

三角形顶点源

参数
pt[]三角形顶点

◆ VectorAngle()

UI_EXP double UtilsMath::VectorAngle ( double  x1,
double  y1,
double  x2,
double  y2 
)

向量基于x轴的夹角

返回
值域(-PI, PI]
鄂公网安备42018502007752 鄂ICP备2024082886
Copyright © 2025 · CBlueStudio 版权所有