_Complex

it.grypho.scala.leonardo.core._Complex
See the_Complex companion class
object _Complex

Companion for the concrete complex value _Complex; holds the smart factory and all arithmetic on _Value operands.

Arithmetic returns Option[_Value]None signals a non-finite or undefined result (e.g. log 0, 0 ^ negative) so the caller stays symbolic, mirroring the "domain errors stay symbolic" contract of the real path.

_Complex.of collapses a zero imaginary part back to a plain _Number, so every existing _Number(x) pattern match across the codebase keeps firing on real results — only a genuinely non-real value ever becomes a _Complex. Binary operations promote _Number operands to (x, 0) via _Complex.parts.

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
_Complex.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def add(a: _Value, b: _Value): Option[_Value]

Complex addition a + b; None when either operand is non-numeric or the result is non-finite.

Complex addition a + b; None when either operand is non-numeric or the result is non-finite.

Attributes

def cosc(v: _Value): Option[_Value]

Complex cosine cos(a + bi) = cos(a)cosh(b) − i·sin(a)sinh(b). None for non-numeric input or non-finite result.

Complex cosine cos(a + bi) = cos(a)cosh(b) − i·sin(a)sinh(b). None for non-numeric input or non-finite result.

Attributes

def coshc(v: _Value): Option[_Value]

Complex hyperbolic cosine cosh(a + bi) = cosh(a)cos(b) + i·sinh(a)sin(b).

Complex hyperbolic cosine cosh(a + bi) = cosh(a)cos(b) + i·sinh(a)sin(b).

Attributes

def cotc(v: _Value): Option[_Value]

Complex cotangent cot(v) = cos(v) / sin(v); None when the sine is zero.

Complex cotangent cot(v) = cos(v) / sin(v); None when the sine is zero.

Attributes

def cothc(v: _Value): Option[_Value]

Complex hyperbolic cotangent coth(v) = cosh(v) / sinh(v); None when the sinh is zero.

Complex hyperbolic cotangent coth(v) = cosh(v) / sinh(v); None when the sinh is zero.

Attributes

def cscc(v: _Value): Option[_Value]

Complex cosecant csc(v) = 1 / sin(v); None when the sine is zero.

Complex cosecant csc(v) = 1 / sin(v); None when the sine is zero.

Attributes

def cschc(v: _Value): Option[_Value]

Complex hyperbolic cosecant csch(v) = 1 / sinh(v); None when the sinh is zero.

Complex hyperbolic cosecant csch(v) = 1 / sinh(v); None when the sinh is zero.

Attributes

def div(a: _Value, b: _Value): Option[_Value]

Complex division a / b; None when either operand is non-numeric, the denominator is zero, or the result is non-finite.

Complex division a / b; None when either operand is non-numeric, the denominator is zero, or the result is non-finite.

Attributes

def expc(v: _Value): Option[_Value]

Complex exponential exp(v) = e^a(cos b + i·sin b) where v = a + bi. None for non-numeric input or non-finite result.

Complex exponential exp(v) = e^a(cos b + i·sin b) where v = a + bi. None for non-numeric input or non-finite result.

Attributes

def logc(v: _Value): Option[_Value]

Principal complex logarithm log(v) = ln|v| + i·arg(v). None when v is zero, non-numeric, or the result is non-finite.

Principal complex logarithm log(v) = ln|v| + i·arg(v). None when v is zero, non-numeric, or the result is non-finite.

Attributes

def mul(a: _Value, b: _Value): Option[_Value]

Complex multiplication a * b; None when either operand is non-numeric or the result is non-finite.

Complex multiplication a * b; None when either operand is non-numeric or the result is non-finite.

Attributes

def of(re: Double, im: Double): _Value

Smart factory: collapses a zero imaginary part to _Number, preserving the real fast-path and all _Number(x) pattern matches.

Smart factory: collapses a zero imaginary part to _Number, preserving the real fast-path and all _Number(x) pattern matches.

Value parameters

im

imaginary part; if 0.0 the result is _Number(re)

re

real part

Attributes

def parts(v: _Value): Option[(Double, Double)]

Extracts the (re, im) parts from any numeric value. None for non-numeric values such as _Bool or _MatrixValue.

Extracts the (re, im) parts from any numeric value. None for non-numeric values such as _Bool or _MatrixValue.

Attributes

def pow(a: _Value, b: _Value): Option[_Value]

Principal complex power z ^ w = exp(w · log z). 0 ^ w is 0 for a positive real w and None otherwise, matching the real path's "0 ^ negative stays symbolic".

Principal complex power z ^ w = exp(w · log z). 0 ^ w is 0 for a positive real w and None otherwise, matching the real path's "0 ^ negative stays symbolic".

Value parameters

a

base

b

exponent

Attributes

def secc(v: _Value): Option[_Value]

Complex secant sec(v) = 1 / cos(v); None when the cosine is zero.

Complex secant sec(v) = 1 / cos(v); None when the cosine is zero.

Attributes

def sechc(v: _Value): Option[_Value]

Complex hyperbolic secant sech(v) = 1 / cosh(v); None when the cosh is zero.

Complex hyperbolic secant sech(v) = 1 / cosh(v); None when the cosh is zero.

Attributes

def sinc(v: _Value): Option[_Value]

Complex sine sin(a + bi) = sin(a)cosh(b) + i·cos(a)sinh(b). None for non-numeric input or non-finite result.

Complex sine sin(a + bi) = sin(a)cosh(b) + i·cos(a)sinh(b). None for non-numeric input or non-finite result.

Attributes

def sinhc(v: _Value): Option[_Value]

Complex hyperbolic sine sinh(a + bi) = sinh(a)cos(b) + i·cosh(a)sin(b).

Complex hyperbolic sine sinh(a + bi) = sinh(a)cos(b) + i·cosh(a)sin(b).

Attributes

def sub(a: _Value, b: _Value): Option[_Value]

Complex subtraction a - b; None when either operand is non-numeric or the result is non-finite.

Complex subtraction a - b; None when either operand is non-numeric or the result is non-finite.

Attributes

def tanc(v: _Value): Option[_Value]

Complex tangent tan(v) = sin(v) / cos(v). None when the cosine is zero, the input is non-numeric, or the result is non-finite.

Complex tangent tan(v) = sin(v) / cos(v). None when the cosine is zero, the input is non-numeric, or the result is non-finite.

Attributes

def tanhc(v: _Value): Option[_Value]

Complex hyperbolic tangent tanh(v) = sinh(v) / cosh(v).

Complex hyperbolic tangent tanh(v) = sinh(v) / cosh(v).

Attributes