18#ifndef BIMHOMEBASE_CALCULATE_H
19#define BIMHOMEBASE_CALCULATE_H
21#include <boost/filesystem.hpp>
24#include <Base/TimeInfo.h>
28#define RAD_TO_DEG(rad) ((rad) * (180.0 / M_PI))
29#define DEG_TO_RAD(angle) ((angle) * (M_PI / 180.0))
97 static int gcd(
int a,
int b);
155 static double distance(
const QPointF& point1,
const QPointF& point2);
164 static double round(
const double v,
const double precision);
static double qRadiansToDegrees(double radians)
将弧度值转换为角度值
static std::string doubleToString(double value, int bit=2)
将 double 类型数值保留指定小数位后转换为 std::string
static bool isNumeric(const std::string &value)
判断字符串是否为数字
static int determineQuadrant(double angle)
判断角度值所在的象限
static int sgn(double x)
判断浮点数的正负性
static double normalizeAngle(double rad)
将角度值归一化到 0 到 2π 之间
static double calculateSectorArea(double radius, double theta)
计算扇形面积
static std::string floatToFraction(double gradient)
将小数转换为分数形式(以 1 为分子)
static double qDegreesToRadians(double degree)
将角度值转换为弧度值
static double truncateDoubleByDecimal(double value, int n)
截断浮点数的小数部分
static std::string radiansToDMS(double angle)
将角度值从弧度转换为度分秒格式
static bool hasDecimal(double num, double epsilon=1e-9)
判断浮点数是否包含小数部分
static double distance(const QPointF &point1, const QPointF &point2)
计算两点之间的欧几里得距离
static double round(const double v, const double precision)
按指定精度对浮点数进行四舍五入
static int gcd(int a, int b)
计算两个整数的最大公约数(GCD)
提供各种数学计算和转换功能的工具类
Definition Calculate.h:40
Definition BaseFigureFactory.h:24