An open API service indexing awesome lists of open source software.

https://github.com/khalidsheet/hs-m12-vector


https://github.com/khalidsheet/hs-m12-vector

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# hs-m12-vector

## Instantiate a new Vector Object

```js
const vector = new Vector(x, y);
```

you can also create a new vector instance by using `of()` static method

```js
const vector2 = Vector.of(x, y);
```

---

## Available Methods

**add(vector)**
Accepts a **Vector** instance

```js
const sum = vector.add(vector2);
```

**abs()**

```js
const abs = sum.abs();
```