Complex

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

Represents double-based complex number.

Constructors

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

Types

Companion
Link copied to clipboard
object Companion : MemorySpec<Complex>

Functions

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

Properties

im
Link copied to clipboard
val im: Double
The imaginary part.
re
Link copied to clipboard
val re: Double
The real part.

Extensions

conjugate
Link copied to clipboard
val Complex.conjugate: Complex
This complex's conjugate.
div
Link copied to clipboard
open operator override fun Complex.div(k: Number): Complex
open operator fun Complex.div(b: Complex): Complex
minus
Link copied to clipboard
operator fun Complex.minus(d: Double): Complex
Subtracts real number from complex one.
open operator fun Complex.minus(b: Complex): Complex
open operator fun Complex.minus(b: Number): Complex
plus
Link copied to clipboard
operator fun Complex.plus(d: Double): Complex
Adds real number to complex one.
open operator fun Complex.plus(b: Complex): Complex
open operator fun Complex.plus(b: Number): Complex
pow
Link copied to clipboard
open infix fun Complex.pow(pow: Number): Complex
r
Link copied to clipboard
val Complex.r: Double
Absolute value of complex number.
reciprocal
Link copied to clipboard
val Complex.reciprocal: Complex
This complex's reciprocal.
theta
Link copied to clipboard
val Complex.theta: Double
An angle between vector represented by complex number and X axis.
times
Link copied to clipboard
open operator fun Complex.times(b: Complex): Complex
open operator fun Complex.times(k: Number): Complex
toQuaternion
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.
unaryMinus
Link copied to clipboard
open operator override fun Complex.unaryMinus(): Complex
unaryPlus
Link copied to clipboard
open operator fun Complex.unaryPlus(): Complex