A Javascript lib about complex

Overview

RealComplex.js

一个关于复数的Javascript库

A Javascript lib about complex

How to use it? 使用教程

  • 导入与实例化
import { Complex } from './Complex.js';
let x = new Complex, y = new Complex;
x.set(real = 5, imag = 3);
y.set(real = -3, imag = -1);
// or
let x = new Complex(5, 3) .......
  • 计算
// 求根
console.log('根号-9 =', Complex.sqrt(-9).toString());
// 加法
console.log('(5+3i)+(-3-i) =', x.plus(y).toString());
// 减法
console.log('(5+3i)-(-3-i) =', x.sub(y).toString());
// 乘法
x.set(3, 2);
y.set(-3, 3);
console.log('(3+2i)*(-3+3i) =', x.mult(y).toString());
// 除法
x.set(-3, 3);
y.set(0.8, 0.6);
console.log('(-3+3i)/(0.8+0.6i) =', x.divby(y).toString());
  • 共轭复数
// 共轭复数
console.log('4+3i的共轭复数 =', Complex.conjugate({ real: 4, imag: 3 }).toString())

Developer 开发者

Lemonix (开发)

ResetPower (提供灵感)

You might also like...

This lib was created with the aim of simplifying the use of serverless Twilio.

Twilio Functions Utils About This lib was created with the aim of simplifying the use of serverless Twilio, reducing the need to apply frequent try-ca

Nov 8, 2022

A lib for text highlighting by using Canvas.

canvas-highlighter 基于 canvas 实现的文本划词高亮,与文本展示的结构完全解耦,不改变文本内容的 DOM 结构。 Installation npm install canvas-highlighter Usage 最简单的实现文本划词直接高亮 import CanvasHig

Dec 24, 2022

This is my to-do list website built with html, css and JavaScript. In this project I used Webpack to bundle JavaScript and ES6 modules to write modular JavaScript.

This is my to-do list website built with html, css and JavaScript. In this project I used Webpack to bundle JavaScript and ES6 modules to write modular JavaScript.

To-Do-List App This is my to-do list website built with html, css and JavaScript. In this project I used Webpack to bundle JavaScript and ES6 modules

Sep 20, 2022

Reference for How to Write an Open Source JavaScript Library - https://egghead.io/series/how-to-write-an-open-source-javascript-library

Reference for How to Write an Open Source JavaScript Library The purpose of this document is to serve as a reference for: How to Write an Open Source

Dec 24, 2022

Open Source projects are a project to improve your JavaScript knowledge with JavaScript documentation, design patterns, books, playlists.

Open Source projects are a project to improve your JavaScript knowledge with JavaScript documentation, design patterns, books, playlists.

It is a project I am trying to list the repos that have received thousands of stars on Github and deemed useful by the JavaScript community. It's a gi

Aug 14, 2022

Javascript-testing-practical-approach-2021-course-v3 - Javascript Testing, a Practical Approach (v3)

Javascript-testing-practical-approach-2021-course-v3 - Javascript Testing, a Practical Approach (v3)

Javascript Testing, a Practical Approach Description This is the reference repository with all the contents and the examples of the "Javascript Testin

Nov 14, 2022

Navigation-Menu-Javascript - A simple Navbar navigation using vanilla javascript, to change links to the active link when clicked.

Navigation-Menu-Javascript - A simple Navbar navigation using vanilla javascript, to change links to the active link when clicked.

Navigation-Menu-Javascript A simple Navbar navigation using vanilla javascript, to change links to the active link when clicked. Desktop view Mobile v

Feb 16, 2021

Ping.js is a small and simple Javascript library for the browser to "ping" response times to web servers in Javascript

Ping.js Ping.js is a small and simple Javascript library for the browser to "ping" response times to web servers in Javascript! This is useful for whe

Dec 27, 2022

MenuSlider-Javascript - How to create a menu slider with vanilla javascript

MenuSlider-Javascript How to create a menu slider with vanilla javascript Instal

Feb 8, 2022
Owner
Lemonix-xxx
Lemonix-xxx
Deploy a multi-account cloud foundation to support highly-regulated workloads and complex compliance requirements.

Landing Zone Accelerator on AWS The Landing Zone Accelerator on AWS solution helps you quickly deploy a secure, resilient, scalable, and fully automat

Amazon Web Services - Labs 130 Dec 29, 2022
high performance、complex interaction table

功能描述 1、高性能、满足复杂交互的编辑表格 2、基于: antd4(https://ant.design/index-cn) ag-grid(https://www.ag-grid.com/) 3、基于原生ag-grid 的API进行封装 一、主要功能 将按下列顺序逐步迭代 1、通用编辑功能 ??

wheel-team 4 Feb 15, 2022
🐻 Trying out the bear necessities for complex state management.

?? Zustand Demos My practice repository for the Zustand library--the bear necessities for complex state management. You can find some examples of how

Carlo Taleon 2 Jul 2, 2022
Start building admin tools on Slack without going into complex slack syntax and flows.

Slackmin Slackmin helps in easy integration with slack to use slash commands, interactive components, format and send messages, design and use modals.

PLG Works 49 Jan 2, 2023
A tiny foundation that providing nested state-based routing for complex web application.

StateMan stateman: A tiny foundation that provides nested state-based routing for complex web applications. stateman is highly inspired by ui-router;

ZhengHaibo 390 Dec 20, 2022
This package support to build a complex application with domain driven design.

The library implement Domain Driven Design for Nodejs base on Typescript. Description This package support to build a complex application with th doma

null 11 Nov 7, 2022
A JavaScript lib with more functions for the normal Date class.

A JavaScript lib with more functions for the normal Date class.

Ícaro Gabriel 4 Jan 26, 2022
Portfólio de projetos pessoais feito com NextJs e lib de animação Framer Motion

Portfólio - Carlos Amorim Esse portfólio foi criado para mostrar meus projetos e habilidades. ?? Projeto criado com as seguintes tecnologias: ✔️ NextJ

Carlos Amorim 13 May 12, 2022
I'm trying to create simple program for adding the digital signature to a pdf file with self-signed certificate. I use node-signpdf and pdf-lib library.

pdf-digital-signature-with-node-signpdf-ejs I'm trying to create simple program for adding the digital signature to a pdf file with self-signed certif

null 5 Dec 25, 2022
Cross-runtime benchmarking lib and cli

mitata cross-runtime benchmarking lib Install bun add mitata npm install mitata Examples import { run, bench, group, baseline } from 'mitata'; // den

evan 165 Jan 3, 2023