Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Complex(val real: Double, val imaginary: Double)

Represents a complex number with a real and imaginary part.

Functions

Link copied to clipboard
fun acos(complex: Complex): Complex

Computes the arc cosine (inverse cosine) of a complex number. The arc cosine is calculated using the formula: acos(z) = -i * ln(z + i * sqrt(1 - z²)) where z is the complex number.

Link copied to clipboard
fun acosh(complex: Complex): Complex

Computes the inverse hyperbolic cosine of a complex number. The inverse hyperbolic cosine is calculated using the formula: acosh(z) = ln(z + sqrt(z² - 1)) where z is the complex number.

Link copied to clipboard
fun asin(complex: Complex): Complex

Computes the arc sine (inverse sine) of a complex number. The arc sine is calculated using the formula: asin(z) = -i * ln(i * z + sqrt(1 - z²)) where z is the complex number.

Link copied to clipboard
fun asinh(complex: Complex): Complex

Computes the inverse hyperbolic sine of a complex number. The inverse hyperbolic sine is calculated using the formula: asinh(z) = ln(z + sqrt(z² + 1)) where z is the complex number.

Link copied to clipboard
fun atan(complex: Complex): Complex

Computes the arc tangent (inverse tangent) of a complex number. The arc tangent is calculated using the formula: atan(z) = (i/2) * ln((i+z)/(i-z)) where z is the complex number.

Link copied to clipboard
fun atanh(complex: Complex): Complex

Computes the inverse hyperbolic tangent of a complex number. The inverse hyperbolic tangent is calculated using the formula: atanh(z) = (1/2) * ln((1+z)/(1-z)) where z is the complex number.

Link copied to clipboard
fun cos(complex: Complex): Complex

Computes the cosine of a complex number. The cosine of a complex number is calculated using the formula: cos(a + bi) = cos(a)cosh(b) - i*sin(a)sinh(b), where a and b are the real and imaginary parts of the complex number, respectively.

Link copied to clipboard
fun cosh(complex: Complex): Complex

Computes the hyperbolic cosine of a complex number. The hyperbolic cosine is calculated using the formula: cosh(a + bi) = cosh(a)cos(b) + i·sinh(a)sin(b), where a and b are the real and imaginary parts of the complex number, respectively.

Link copied to clipboard
fun cot(complex: Complex): Complex

Computes the cotangent of a complex number. The cotangent is calculated using the formula cot(z) = cos(z) / sin(z), where z is the complex number.

Link copied to clipboard
fun Double.cpow(exponent: Double): Complex

Raises a real number to the power of the given exponent and returns the result as a complex number.

Link copied to clipboard
operator fun Double.div(other: Complex): Complex

Divides a double-precision floating-point number by a complex number and returns the result.

Link copied to clipboard
fun exp(complex: Complex): Complex

Computes the exponential of a complex number. The exponential is calculated using the formula: exp(a + bi) = e^a * (cos(b) + i*sin(b)) where a and b are the real and imaginary parts of the complex number, respectively.

Link copied to clipboard
fun ln(complex: Complex): Complex

Computes the natural logarithm of a complex number. The natural logarithm is calculated using the formula: ln(z) = ln(|z|) + i * arg(z) where |z| is the magnitude and arg(z) is the argument of the complex number.

Link copied to clipboard
fun log(x: Complex, base: Double): Complex

Computes the logarithm of a complex number with a specified base. The logarithm with base b is calculated using the formula: log_b(z) = ln(z) / ln(b) where z is the complex number and b is the base.

fun log(x: Complex, base: Complex): Complex

Computes the logarithm of a complex number with a specified complex base. The logarithm with base b is calculated using the formula: log_b(z) = ln(z) / ln(b) where z is the complex number and b is the complex base.

Link copied to clipboard
fun Double.pow(exponent: Complex): Complex

Raises a real number to the power of a complex number.

Link copied to clipboard
fun sin(complex: Complex): Complex

Computes the sine of a given complex number using the formula: sin(z) = sin(a) * cosh(b) - i * cos(a) * sinh(b), where z = a + bi is the complex number, a is the real part, and b is the imaginary part.

Link copied to clipboard
fun sinh(complex: Complex): Complex

Computes the hyperbolic sine of a complex number. The hyperbolic sine is calculated using the formula: sinh(a + bi) = sinh(a)cos(b) + i·cosh(a)sin(b), where a and b are the real and imaginary parts of the complex number, respectively.

Link copied to clipboard
fun tan(complex: Complex): Complex

Computes the tangent of a given complex number. The tangent of a complex number is calculated as the quotient of its sine and cosine.

Link copied to clipboard
fun tanh(complex: Complex): Complex

Computes the hyperbolic tangent of a complex number. The hyperbolic tangent is calculated using the formula: tanh(z) = sinh(z) / cosh(z) where z is the complex number.