Komplex

A Kotlin module for performing complex number and complex polynomial operations

Лицензия

Лицензия

Группа

Группа

com.tecacet
Идентификатор

Идентификатор

komplex
Последняя версия

Последняя версия

1.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Komplex
A Kotlin module for performing complex number and complex polynomial operations
Ссылка на сайт

Ссылка на сайт

https://github.com/algorythmist/komplex
Организация-разработчик

Организация-разработчик

TecAceT
Система контроля версий

Система контроля версий

https://github.com/algorythmist/komplex

Скачать komplex

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.tecacet/komplex/ -->
<dependency>
    <groupId>com.tecacet</groupId>
    <artifactId>komplex</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.tecacet/komplex/
implementation 'com.tecacet:komplex:1.2.1'
// https://jarcasting.com/artifacts/com.tecacet/komplex/
implementation ("com.tecacet:komplex:1.2.1")
'com.tecacet:komplex:jar:1.2.1'
<dependency org="com.tecacet" name="komplex" rev="1.2.1">
  <artifact name="komplex" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.tecacet', module='komplex', version='1.2.1')
)
libraryDependencies += "com.tecacet" % "komplex" % "1.2.1"
[com.tecacet/komplex "1.2.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.10

test (1)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-api jar 5.6.2

Модули Проекта

Данный проект не имеет модулей.

komplex

komplex is a Kotlin library for Complex Analysis. It supports complex number and complex polynomial arithmetic.

Complex Arithmetic

import com.tecacet.komplex.*

 val c1 = Complex(2.0, -3.1)
 val c2 = 2 + 3*i
 val c3 = 5*c1 + i*PI

All the standard special functions are defined:

var c = sec(z)
var c = exp(z)
var c = tanh(z)
var c = ln(z)
var c = pow(z, 2.0)
var c = pow(z, z2)

et cetera...

It is also possible to define powers of complex numbers in infix notation:

val c = 1.0 + 0.5 * i
val c10 = c to 10

val c = (1 + 2*i)to 2*i

Complex Polynomials

The library supports complex polynomials and their operations

val p1 = ComplexPolynomial(1 + i, i, 1 + 0 * i)
val p2 = ComplexPolynomial(ONE, i * 2 + 1, i, i - 2)

val p3 = p1 + p2
val p4 = p1 * p2

Division of complex polynomials returns the quotient and remainder:

val dividend = ComplexPolynomial(ONE, ONE, i)
val divisor = ComplexPolynomial(ONE, i)
val (quotient, remainder) = divide(dividend, divisor)

Complex polynomials can be defined using infix notation in terms of the variable Z which represents the first order monomial:

val q = (1.0 + 1.0 * i) * (Z to 3) + 2.0 * (Z to 2) + 1.0 * Z - (1.0 + 0.5 * i)
assertEquals("(-1.0-0.5i)+(1.0)z+(2.0)z^2+(1.0+1.0i)z^3", q.toString())

Версии библиотеки

Версия
1.2.1
1.1.0
1.0.0