Complex

data class Complex(re: Double, im: Double)

Represents double-based complex number.

Constructors

Link copied to clipboard
fun Complex(re: Number, im: Number)
Link copied to clipboard
fun Complex(re: Number)
Link copied to clipboard
fun Complex(re: Double, im: Double)

Types

Link copied to clipboard
object Companion : MemorySpec<Complex>

Functions

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val im: Double

The imaginary part.

Link copied to clipboard
val re: Double

The real part.

Extensions

Link copied to clipboard
val Complex.conjugate: Complex

This complex's conjugate.

Link copied to clipboard
open operator override fun Complex.div(k: Number): Complex
open operator fun Complex.div(arg: StructureND<Complex>): StructureND<Complex>
open operator fun Complex.div(arg: Complex): Complex
Link copied to clipboard
operator fun Complex.minus(d: Double): Complex

Subtracts real number from complex one.

open operator fun Complex.minus(arg: Complex): Complex
open operator fun Complex.minus(other: Number): Complex
open operator fun Complex.minus(arg: StructureND<Complex>): StructureND<Complex>
Link copied to clipboard
operator fun Complex.plus(d: Double): Complex

Adds real number to complex one.

open operator fun Complex.plus(arg: Complex): Complex
open operator fun Complex.plus(other: Number): Complex
open operator fun Complex.plus(arg: StructureND<Complex>): StructureND<Complex>
Link copied to clipboard
open infix fun Complex.pow(pow: Number): Complex
Link copied to clipboard
val Complex.r: Double

Absolute value of complex number.

Link copied to clipboard
val Complex.reciprocal: Complex

This complex's reciprocal.

Link copied to clipboard
val Complex.theta: Double

An angle between vector represented by complex number and X axis.

Link copied to clipboard
open operator fun Complex.times(arg: Complex): Complex
open operator fun Complex.times(k: Number): Complex
open operator fun Complex.times(arg: StructureND<Complex>): StructureND<Complex>
Link copied to clipboard
fun Complex.toQuaternion(): Quaternion

Creates a quaternion with w-component equal to re-component of given complex and x-component equal to im-component of given complex.

Link copied to clipboard
open operator override fun Complex.unaryMinus(): Complex
Link copied to clipboard
open operator fun Complex.unaryPlus(): Complex

Sources

Link copied to clipboard