# kld-affine

> A collection of classes used in affine geometry

Latest version **2.1.1** (published 2019-05-09) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install kld-affine
pnpm add kld-affine
yarn add kld-affine
bun add kld-affine
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2019-05-09 |
| First published | 2013-08-01 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 10.15.3 |
| Dependencies | 0 |
| Unpacked size | 192.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Author | Kevin Lindsey |
| Maintainers | thelonious |
| Keywords | affine, point, vector, matrix |

## Links

- npm: https://www.npmjs.com/package/kld-affine
- Repository: https://github.com/thelonious/kld-affine
- Issues: https://github.com/thelonious/kld-affine/issues
- npm.io page: https://npm.io/package/kld-affine

## Recent versions

- 2.1.1 (latest) — 2019-05-09
- 2.1.0 — 2019-05-07
- 2.0.4 — 2017-07-21
- 2.0.3 — 2017-07-20
- 2.0.2 — 2017-07-20
- 2.0.1 — 2017-07-19
- 2.0.0 — 2016-09-17
- 1.0.0 — 2015-10-10
- 0.1.0 — 2015-01-12
- 0.0.6 — 2013-11-15
- 0.0.5 — 2013-11-15
- 0.0.4 — 2013-11-15
- 0.0.3 — 2013-11-15
- 0.0.2 — 2013-08-01
- 0.0.1 — 2013-08-01

## README

# kld-affine

- [Installation](#installation)
- [Importing](#importing)
- [API](#api)

---

A collection of classes used for affine geometry. This currently consists of the following classes:

* Point2D
* Vector2D
* Matrix2D

# Installation

```
npm install kld-affine
```

# Importing

The following sections indicate how you can import the code for use in various environments.

## Node

```javascript
import {Point2D, Vector2D, Matrix2D} = require("kld-affine");
```

## ESM in Modern Browsers

```javascript
import {Point2D, Vector2D, Matrix2D} from './node_modules/kld-affine/dist/index-esm.js';
```

## Older Browsers

```html
<script src="./node_modules/kld-affine/dist/index-umd.js"></script>
<script>
  var Point2D = KldAffine.Point2D;
  var Vector2D = KldAffine.Vector2D;
  var Matrix2D = KldAffine.Matrix2D;
</script>
```

## Bundlers

```javascript
import {Point2D, Vector2D, Matrix2D} from "kld-affine";
```

# API

## Point2D

A class used to represent two-dimensional points on a plane. This currently supports the following methods:

* clone
* add
* subtract
* multiply
* divide
* equals
* precisionEquals
* lerp
* distanceFrom
* min
* max
* transform
* toString

## Vector2D

A class used to represent a two-dimensional vector. This currently supports the following methods:

* Vector2D.fromPoints
* length
* magnitude
* dot
* cross
* determinant
* unit
* add
* subtract
* multiply
* divide
* angleBetween
* perp
* perpendicular
* project
* transform
* equals
* precisionEquals
* toString

## Matrix2D

A class used to represent affine transformations. This current supports the following methods:

* Matrix2D.IDENTITY
* Matrix2D.translation
* Matrix2D.scaling
* Matrix2D.scalingAt
* Matrix2D.nonUniformScaling
* Matrix2D.nonUniformScalingAt
* Matrix2D.rotation
* Matrix2D.rotationAt
* Matrix2D.rotationFromVector
* Matrix2D.xFlip
* Matrix2D.yFlip
* Matrix2D.xSkew
* Matrix2D.ySkew
* multiply
* inverse
* translate
* scale
* scaleAt
* scaleNonUniform
* scaleNonUniformAt
* rotate
* rotateAt
* rotateFromVector
* flipX
* flipY
* skewX
* skewY
* isIdentity
* isInvertible
* getScale
* getDecomposition
* equals
* precisionEquals
* toString

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