# @alessiofrittoli/math-utils 中文文档

规范地址：https://npmcn.com/package/%40alessiofrittoli/math-utils/

版本：3\.0\.1
npm 元数据更新时间：2026-10-28T19:52:25.545Z
中文译文更新时间：2026-11-06T14:17:02.727Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40alessiofrittoli/math-utils
原文对照：https://npmcn.com/package/%40alessiofrittoli/math-utils/?lang=original
项目主页：https://github.com/alessiofrittoli/math-utils#readme
源码仓库：https://github.com/alessiofrittoli/math-utils

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：64.7 kB，17 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=24\.15\.0
- 运行依赖：0 个
- peer 依赖：@alessiofrittoli/typed-map ^1\.1\.0
- 首次发布：2024-11-24T00:03:42.390Z
- 最新版本发布：2026-10-28T19:50:18.207Z
- 近 30 天下载量：3021（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：32（近 12 个月 11 个）

## 中文简介

轻量级类型Script 数学工具函数

## 安装

```sh
npm install @alessiofrittoli/math-utils
```

也可以使用：`pnpm add @alessiofrittoli/math-utils`、`yarn add @alessiofrittoli/math-utils`、`bun add @alessiofrittoli/math-utils`

## README

# 数学 Utils QQ

## 轻量级类型Script 数学工具函数

这种轻量级的TypeScript工具库带有通用和实用的数学功能.

 [![Latest version](https://img.shields.io/npm/v/@alessiofrittoli/math-utils)](https://npmjs.org/package/@alessiofrittoli/math-utils)[![Test coverage](https://coveralls.io/repos/github/alessiofrittoli/math-utils/badge.svg) ](https://coveralls.io/github/alessiofrittoli/math-utils)[![Socket Security score](https://socket.dev/api/badge/npm/package/@alessiofrittoli/math-utils) ](https://socket.dev/npm/package/@alessiofrittoli/math-utils/overview)[![npm downloads](https://img.shields.io/npm/dm/@alessiofrittoli/math-utils.svg) ](https://npmjs.org/package/@alessiofrittoli/math-utils)[![Dependencies](https://badgen.net/bundlephobia/dependency-count/@alessiofrittoli/math-utils) ](https://bundlephobia.com/package/@alessiofrittoli/math-utils)[![Dependencies status](https://img.shields.io/librariesio/release/npm/@alessiofrittoli/math-utils)](https://libraries.io/npm/%40alessiofrittoli%2Fmath-utils)

 [![minified](https://badgen.net/bundlephobia/min/@alessiofrittoli/math-utils)](https://bundlephobia.com/package/@alessiofrittoli/math-utils)[![minizipped](https://badgen.net/bundlephobia/minzip/@alessiofrittoli/math-utils) ](https://bundlephobia.com/package/@alessiofrittoli/math-utils)[![Tree shakable](https://badgen.net/bundlephobia/tree-shaking/@alessiofrittoli/math-utils)](https://bundlephobia.com/package/@alessiofrittoli/math-utils)

[![Fund this package](https://img.shields.io/static/v1?label=Fund%20this%20package&message=%E2%9D%A4&logo=GitHub&color=%23DB61A2)](https://github.com/sponsors/alessiofrittoli)

### 目录

-   [开始](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-getting-started)
-   [变了什么](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-whats-changed)
-   里面的东西
    -   [转换功能](https://github.com/alessiofrittoli/math-utils/blob/master/docs/conversion/README.md)
    -   [格式化函数](https://github.com/alessiofrittoli/math-utils/blob/master/docs/format/README.md)
    -   [帮助者功能](https://github.com/alessiofrittoli/math-utils/blob/master/docs/helpers/README.md)
    -   [内插函数](https://github.com/alessiofrittoli/math-utils/blob/master/docs/interpolation/README.md)
    -   [简化职能](https://github.com/alessiofrittoli/math-utils/blob/master/docs/easing/README.md)
    -   [We](https://github.com/alessiofrittoli/math-utils/blob/master/docs/Tween/README.md)
    -   [随机数函数](https://github.com/alessiofrittoli/math-utils/blob/master/docs/random/README.md)
    -   [类型](https://github.com/alessiofrittoli/math-utils/blob/master/docs/types/README.md)
-   [发展](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-development)
    -   [地方发展](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-local-development)
    -   [生产建设](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-production-build)
    -   [单位测试](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-unit-tests)
        -   [进行覆盖测试](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-run-tests-with-coverage)
    -   [捐款](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-contributing)
    -   [警卫](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-security)
-   [贷项](https://npmcn.com/package/%40alessiofrittoli/math-utils/#readme-made-with-)

* * *

### 开始

运行以下命令开始使用 `math-utils` 在您的项目中:

```bash
npm i @alessiofrittoli/math-utils
```

或使用 `pnpm`

```bash
pnpm i @alessiofrittoli/math-utils
```

* * *

### 变了什么

#### 最新版本的更新 QQ

-   欢迎 [`Tween`](https://github.com/alessiofrittoli/math-utils/blob/master/docs/Tween/README.md)来啊!
-   删除已贬值 `easeOutCirc` 赞成: `Easings.easeOutCirc()` 函数. 见 [简化 API 参考](https://github.com/alessiofrittoli/math-utils/blob/master/docs/easing/README.md) 需要更多信息.

* * *

### 发展

运行以下开始开发

```shell
nvm use

pnpm i
```

#### 地方发展

运行以下

```shell
pnpm dev
```

这将生成未忽略的输出代码, 源图并启用源文件监视器 .

* * *

#### 生产建设

运行以下来创建本地生产建筑

```shell
pnpm build
```

这将生成没有源代码的已修改输出代码 .

* * *

#### 单位测试

通过运行下列程序运行所有定义的测试套件 :

```shell
# Run tests and watch file changes.
pnpm test:watch

# Run tests in a CI environment.
pnpm test:ci
```

* * *

##### 进行覆盖测试

然后开始使用 HTTP 服务器服务覆盖文件 `./coverage` 文件夹.

您可以在您第一次运行此命令时看到空白页 。 只需刷新浏览器即可看到更新 .

```shell
pnpm test:coverage:serve
```

* * *

#### 捐款

献礼真受欢迎!

请参看 [贡献文件](https://npmcn.com/package/%40alessiofrittoli/math-utils/CONTRIBUTING.md) 了解如何开始为该项目作出贡献的更多信息.

帮助更新此项目 [GitHub 赞助商](https://github.com/sponsors/alessiofrittoli)。 。 。 .

[![GitHub Sponsor](https://img.shields.io/static/v1?label=Fund%20this%20package&message=%E2%9D%A4&logo=GitHub&color=%23DB61A2)](https://github.com/sponsors/alessiofrittoli)

* * *

#### 警卫

如果你认为你发现了安全漏洞 我们鼓励你 **_负责地披露此事,不公开问题_**我们将调查所有合法的报告。 电子邮件 `security@alessiofrittoli.it` 披露任何安全弱点.

* * *

### 由 所制

<table><tbody><tr><td><img alt="avatar" src="https://avatars.githubusercontent.com/u/35973186" loading="lazy" decoding="async" referrerpolicy="no-referrer"></td><td><table><tbody><tr><td><a href="https://github.com/alessiofrittoli" rel="nofollow noopener noreferrer">阿莱西奥·弗里托利</a></td></tr><tr><td><small><a href="https://alessiofrittoli.it/" rel="nofollow noopener noreferrer">https://alessiofrittoli.it (英语)</a> | <a href="mailto:info@alessiofrittoli.it" rel="nofollow noopener noreferrer">(原始内容存档于2018-10-21) (英语). info.it</a></small></td></tr></tbody></table></td></tr></tbody></table>

## 常见问题

### @alessiofrittoli/math-utils 是什么？

轻量级类型Script 数学工具函数

### 如何安装 @alessiofrittoli/math-utils？

在项目目录运行 npm install @alessiofrittoli/math-utils，或使用 pnpm add / yarn add / bun add。

### @alessiofrittoli/math-utils 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @alessiofrittoli/math-utils 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @alessiofrittoli/math-utils 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=24\.15\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @alessiofrittoli/math-utils 可以商用吗？

@alessiofrittoli/math-utils 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @alessiofrittoli/math-utils 的下载量有多少？

根据 npm 官方下载统计，@alessiofrittoli/math-utils 在 2026/10/06 – 2026/11/04 这 30 天内被下载 3,021 次，日均约 101 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @alessiofrittoli/math-utils 还在维护吗？

最新版本 3\.0\.1 发布于 2026/10/29（10 天前）；至今共发布 32 个版本，其中过去 12 个月发布了 11 个；首次发布于 2024/11/24。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

