# imagine-node

> node module to work with complex numbers

Latest version **1.1.0** (published 2018-05-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install imagine-node
pnpm add imagine-node
yarn add imagine-node
bun add imagine-node
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-05-13 |
| First published | 2018-04-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jesus Edel Cereceres |
| Maintainers | cereceres |
| Keywords | imaginary, numbers, node, real, complex |

## Links

- npm: https://www.npmjs.com/package/imagine-node
- Repository: https://github.com/Cereceres/imagine-node
- Homepage: https://github.com/Cereceres/imagine-node#readme
- Issues: https://github.com/Cereceres/imagine-node/issues
- npm.io page: https://npm.io/package/imagine-node

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2018-05-13
- 1.0.7 — 2018-05-10
- 1.0.6 — 2018-05-08
- 1.0.5 — 2018-05-07
- 1.0.4 — 2018-05-07
- 1.0.3 — 2018-05-07
- 1.0.2 — 2018-05-06
- 1.0.1 — 2018-05-06
- 1.0.0 — 2018-05-06
- 0.1.5 — 2018-05-04
- 0.1.4 — 2018-05-03
- 0.1.3 — 2018-04-22
- 0.1.2 — 2018-04-22
- 0.1.1 — 2018-04-21
- 0.1.0 — 2018-04-21
- … 2 more at https://npm.io/package/imagine-node/versions

## README

# imagine-node

[![Join the chat at https://gitter.im/imagine-node/Lobby](https://badges.gitter.im/imagine-node/Lobby.svg)](https://gitter.im/imagine-node/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
module to work with complex numbers

# Install 

```bash
npm install imagine-node
```

# Usage

```js
const complex = new Complex(1, 1);
complex.toString() // 1+i
const chainingComplex = complex
    .add({ real: 2, imaginary:3 })
    .sub({ real: 1, imaginary:1 })
    .multiply({ real: 2, imaginary:-3 })
    .div({ real: 2, imaginary:3 });
assert(chainingComplex.real === 2);
assert(chainingComplex.imaginary === -3);ç

complex
    .ln()
    .multiply({ real:1, imaginary:1 })
    .exp()
// Definitions and usage examples
cos() {
    return this
        .multiply({ imaginary:1 })
        .exp()
        .add(
            this.multiply({ imaginary:-1 }).exp()
        )
        .div({ real:2 });
}

acos() {
    return this
        .add(this.pow(2).sub(1).sqrt()[0])
        .ln()
        .multiply(Complex.im(-1));
}

asin() {
    return this
        .multiply(Complex.im())
        .add(Complex.re(1).sub(this.pow(2)).sqrt()[0])
        .ln()
        .multiply(Complex.im(-1));
}

atang() {
    return Complex.re(1)
        .sub(this.multiply(Complex.im()))
        .ln()
        .sub(Complex
            .re(1)
            .add(this.multiply(Complex.im()))
            .ln()
        )
        .multiply(Complex.im(0.5));
}

sin() {
    return this
        .multiply({ imaginary:1 })
        .exp()
        .sub(
            this.multiply({ imaginary:-1 }).exp()
        )
        .div({ imaginary: 2 });
}

```
# API imagineClass(real, imaginary)

# Properties

## real Number

## imaginary Number

# ClassMethods

## add({real, imaginary}, {real, imaginary}) -> imagineInstance
## sub({real, imaginary}, {real, imaginary}) -> imagineInstance
## div({real, imaginary}, {real, imaginary}) -> imagineInstance
## multiply({real, imaginary}, {real, imaginary}) -> imagineInstance
## ln({real, imaginary}) -> imagineInstance
## cos({real, imaginary}) -> imagineInstance
## asin({real, imaginary}) -> imagineInstance
## acos({real, imaginary}) -> imagineInstance
## sinh({real, imaginary}) -> imagineInstance
## cosh({real, imaginary}) -> imagineInstance
## atang({real, imaginary}) -> imagineInstance
## norm({real, imaginary}) -> number
## polar({real, imaginary}) -> {norm, theta}
## theta({real, imaginary}) -> number


## sin({real, imaginary}) -> imagineInstance
## pow({real, imaginary}, {real, imaginary}) -> imagineInstance
## sqrt({real, imaginary},integer) ->ArrayOfImagineInstance
## inverse({real, imaginary}) ->imagineInstance
## im(number) -> imagineInstance
return a complex number with only imaginary part equal to number given
## toString({real, imaginary}) -> string

## re(number) -> imagineInstance
return a complex number with only real part equal to number given

return a imaginary number
# InstanceMethods

## add({real, imaginary}) -> imagineInstance
## sub({real, imaginary}) -> imagineInstance
## div({real, imaginary}) -> imagineInstance
## multiply({real, imaginary}) -> imagineInstance
## ln() -> imagineInstance
## cos() -> imagineInstance
## sin() -> imagineInstance
## cosh() -> imagineInstance
## sinh() -> imagineInstance
## norm() -> number
## polar() -> {norm, theta}
## theta() -> number

## asin() -> imagineInstance
## acos() -> imagineInstance
## atang() -> imagineInstance
## pow({real, imaginary}) -> imagineInstance
## sqrt(integer) ->ArrayOfImagineInstance
## inverse() ->imagineInstance
## im() -> imagineInstance
return a complex number with only imaginary part
## toString() -> string

## re() -> imagineInstance
return a complex number with only real part

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