# @antv/matrix-util

> A common util collection for antv projects

Latest version **3.0.4** (published 2020-12-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install @antv/matrix-util
pnpm add @antv/matrix-util
yarn add @antv/matrix-util
bun add @antv/matrix-util
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.4 |
| Published | 2020-12-21 |
| First published | 2019-04-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 72 |
| Author | https://github.com/orgs/antvis/people |
| Maintainers | elaine.q.10, sakuya223, leungwensen, dori, simaq, dxq613, lzxue, army8735, atool, baizn, dengfuping, neoddish, jeffy2012, zqlu, afc163, pomelo-nwu, kopiluwaky, ccnuzindex, panyuqi, bubkoo, zengyue, kasmine, wufenfen92, boyu.zlj, l1ud0ngq1, newbyvector, winniexing, chenluli, kn9117, xdddst, semious2020, esora, nadia_liu |
| Keywords | util, antv, g |

## Links

- npm: https://www.npmjs.com/package/@antv/matrix-util
- Repository: https://github.com/antvis/util
- Homepage: https://github.com/antvis/util#readme
- Issues: https://github.com/antvis/util/issues
- npm.io page: https://npm.io/package/@antv/matrix-util

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^2.0.3
- [gl-matrix](https://npm.io/package/gl-matrix.md) ^3.3.0
- [@antv/util](https://npm.io/package/@antv/util.md) ^2.0.9

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 3.0.4 (latest) — 2020-12-21
- 3.1.0-beta.3 (beta) — 2021-10-14
- 3.1.0-beta.2 — 2020-05-12
- 3.1.0-beta.1 — 2020-05-10
- 3.0.4-beta.7 — 2020-05-09
- 3.0.4-beta.6 — 2020-05-09
- 3.0.4-beta.5 — 2020-05-09
- 3.0.4-beta.4 — 2020-05-09
- 3.0.4-beta.3 — 2020-05-09
- 3.0.4-beta.2 — 2020-05-09
- 3.0.4-beta.1 — 2020-05-07
- 3.0.3 — 2020-05-07
- 3.0.2 — 2020-04-24
- 3.0.1-beta.3 — 2020-04-24
- 3.0.1-beta.2 — 2020-04-24
- … 15 more at https://npm.io/package/@antv/matrix-util/versions

## README

# matrix-util

> 扩展了 gl-matrx 的 vec2, vec3, mat3, transform 方法


## 安装下载

> tnpm i --save @antv/util

```js
// 所有的 api 是都这么引入，名字不同而已
import { vec2, vec3 } from '@antv/matrix-util';

vec2.angle(v1, v2);
```


## API 文档

> 推荐使用的 API 文档如下：
* vec2 新增了以下方法：
    + angle(v1, v2)
    + direction(v1, v2)
    + angleTo(v1, v2)
    + vertical(out, in) 求垂直向量
* vec3 未新增方法
* mat3 新增：
    + translate(out, m, v)
    + rotate(out, m, rad)
    + scale(out, m, v)
* transform(m, [])
```js
transform(m, [
    ['t', 100, 200],
    ['r', 40],
    ['s', 2, 2]
]);
```

---
_Source: https://npm.io/package/@antv/matrix-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
