# @amandaghassaei/vector-math 中文文档

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

版本：1\.1\.8
npm 元数据更新时间：2025-12-10T05:09:24.999Z
中文译文更新时间：2026-11-08T10:00:00.403Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：173 kB，47 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2023-06-07T00:00:37.256Z
- 最新版本发布：2025-12-10T05:09:24.802Z
- 近 30 天下载量：1810（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：41（近 12 个月 1 个）

## 中文简介

一个处理2D/3D翻译和旋转的最小向量数学库,用TypeScript来写.

## 安装

```sh
npm install @amandaghassaei/vector-math
```

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

## README

# @amandaghassaei/医生-math

[![NPM Package](https://img.shields.io/npm/v/@amandaghassaei/vector-math)](https://www.npmjs.com/package/@amandaghassaei/vector-math) [![Build Size](https://img.shields.io/bundlephobia/min/@amandaghassaei/vector-math)](https://bundlephobia.com/result?p=@amandaghassaei/vector-math) [![NPM Downloads](https://img.shields.io/npm/dw/@amandaghassaei/vector-math)](https://www.npmtrends.com/@amandaghassaei/vector-math) [![License](https://img.shields.io/npm/l/@amandaghassaei/vector-math)](https://github.com/amandaghassaei/vector-math/blob/main/LICENSE) ![](https://img.shields.io/badge/Coverage-100%25-83A603.svg?prefix=$coverage$)

一个处理2D/3D翻译和旋转的最小向量数学库.

-   用 Typescript 写成, 有导出类型声明 .
-   支助 [三个 Js's (英语)](https://github.com/mrdoob/three.js) 矢量2,矢量3,和克特克尼翁类型作为输入.
-   包括只读类类型.
-   包括100%覆盖的单位测试.

目录:

-   [安装](https://npmcn.com/package/%40amandaghassaei/vector-math/#readme-installation)
-   [使用](https://npmcn.com/package/%40amandaghassaei/vector-math/#readme-use)
-   [许可证](https://npmcn.com/package/%40amandaghassaei/vector-math/#readme-license)
-   [承认](https://npmcn.com/package/%40amandaghassaei/vector-math/#readme-acknowledgments)
-   [发展](https://npmcn.com/package/%40amandaghassaei/vector-math/#readme-development)

## 安装

### 通过国家预防机制安装

```sh
npm install @amandaghassaei/vector-math
```

然后通过 :

```js
import { Vector2 } from '@amandaghassaei/vector-math';
```

### 作为联署材料安装

_或_ 您可以在浏览器中添加 [捆绑/教练-math.js](https://github.com/amandaghassaei/vector-math/blob/main/bundle/vector-math.js) 或者说 [捆绑/医生-math.min.js](https://github.com/amandaghassaei/vector-math/blob/main/bundle/vector-math.min.js) 转到您的 html :

```html
<html>
    <head>
        ....
        <script src="vector-math.min.js"></script>
    </head>
    <body>
    </body>
</html>
```

在您的js文件中, 您可以访问全局变量 `VECTOR_MATH`数字 :

```js
const { Vector2 } = VECTOR_MATH;
```

## 使用

参见完整的 API 文档 [文档/](https://github.com/amandaghassaei/vector-math/tree/main/docs)。 。 。 .

## 许可证

这份作品在以下一项下分发: [麻省理工学院许可证](https://github.com/amandaghassaei/vector-math/blob/main/LICENSE)它没有依赖关系.

## 承认

大部分图书馆是从 [三.js的源代码](https://github.com/mrdoob/three.js)。 。 。 .

## 发展

请随意提交与错误或类型问题有关的拉动请求, 但我可能不想将这个库的功能扩展到它目前的位置。 外有其他图书馆,涵盖更广阔的线性代数函数和类型,这个图书馆本意是小而有范围.

安装非依赖性 :

```sh
npm install
```

从 `src` 改为 `dist` 并汇编文件:

```sh
npm run build
```

包含代码的测试 :

```sh
npm run test-with-coverage
```

## 常见问题

### @amandaghassaei/vector-math 是什么？

一个处理2D/3D翻译和旋转的最小向量数学库,用TypeScript来写\.

### 如何安装 @amandaghassaei/vector-math？

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

### @amandaghassaei/vector-math 支持 TypeScript 吗？

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

### @amandaghassaei/vector-math 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @amandaghassaei/vector-math 可以商用吗？

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

### @amandaghassaei/vector-math 的下载量有多少？

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

### @amandaghassaei/vector-math 还在维护吗？

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

