scalation.math

Complex

case class Complex(re: Double, im: Double) extends Fractional[Complex] with Ordered[Complex] with Product with Serializable

This class is used to represent complex numbers (a + bi) as (a, b), e.g., (2.1, 3.2i). Note: i * i = -1.

re

the real part

im

the imaginary part

Linear Supertypes
Product, Equals, Ordered[Complex], Comparable[Complex], Fractional[Complex], Numeric[Complex], Ordering[Complex], Serializable, Serializable, PartialOrdering[Complex], Equiv[Complex], Comparator[Complex], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Complex
  2. Product
  3. Equals
  4. Ordered
  5. Comparable
  6. Fractional
  7. Numeric
  8. Ordering
  9. Serializable
  10. Serializable
  11. PartialOrdering
  12. Equiv
  13. Comparator
  14. AnyRef
  15. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Complex(re: Double, im: Double = 0.0)

    re

    the real part

    im

    the imaginary part

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def *(r: Double): Complex

    Multiply a complex numbers times double.

    Multiply a complex numbers times double.

    r

    multiply this times r

  5. def *(c: Complex): Complex

    Multiply two complex numbers.

    Multiply two complex numbers.

    c

    multiply this times c

  6. def +(r: Double): Complex

    Add a complex number plus double.

    Add a complex number plus double.

    r

    add r to this

  7. def +(c: Complex): Complex

    Add two complex numbers.

    Add two complex numbers.

    c

    add complex c to this

  8. def -(r: Double): Complex

    Subtract: a complex number minus double.

    Subtract: a complex number minus double.

    r

    subtract r from this

  9. def -(c: Complex): Complex

    Subtract two complex numbers.

    Subtract two complex numbers.

    c

    subtract c from this

  10. def /(r: Double): Complex

    Divide a complex numbers div double.

    Divide a complex numbers div double.

    r

    divide this by r

  11. def /(c: Complex): Complex

    Divide two complex numbers.

    Divide two complex numbers.

    c

    divide this by c

  12. def <(that: Complex): Boolean

    Definition Classes
    Ordered
  13. def <=(that: Complex): Boolean

    Definition Classes
    Ordered
  14. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  16. def >(that: Complex): Boolean

    Definition Classes
    Ordered
  17. def >=(that: Complex): Boolean

    Definition Classes
    Ordered
  18. def abs: Complex

    Return the absolute value of this complex number.

  19. def abs(x: Complex): Complex

    Definition Classes
    Numeric
  20. def angle: Double

    Return the angle of the complex number as a vector in the re-im plane.

  21. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  22. def bar: Complex

    Return the complex conjugate: if z = (a + bi) then z.

    Return the complex conjugate: if z = (a + bi) then z.bar = (a - bi).

  23. def canEqual(arg0: Any): Boolean

    Definition Classes
    Complex → Equals
  24. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. def compare(d: Complex): Int

    Compare this complex number with that complex number d.

    Compare this complex number with that complex number d.

    d

    that complex number

    Definition Classes
    Complex → Ordered
  26. def compare(c: Complex, d: Complex): Int

    Compare two complex numbers (negative for <, zero for ==, positive for >).

    Compare two complex numbers (negative for <, zero for ==, positive for >).

    c

    the first complex number to compare

    d

    the second complex number to compare

    Definition Classes
    Complex → Ordering → Comparator
  27. def compareTo(that: Complex): Int

    Definition Classes
    Ordered → Comparable
  28. def div(c: Complex, r: Double): Complex

  29. def div(c: Complex, d: Complex): Complex

    Definition Classes
    Complex → Fractional
  30. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. def equals(c: Any): Boolean

    Override equals to determine whether this complex number equals complex c.

    Override equals to determine whether this complex number equals complex c.

    c

    the complex number to compare with this

    Definition Classes
    Complex → Equals → Comparator → AnyRef → Any
  32. def equiv(x: Complex, y: Complex): Boolean

    Definition Classes
    Ordering → PartialOrdering → Equiv
  33. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  34. def fromDouble(x: Double): Complex

    Create a complex number from a Double.

    Create a complex number from a Double.

    x

    the double used to create the complex number

  35. def fromFloat(x: Float): Complex

    Create a complex number from a Float.

    Create a complex number from a Float.

    x

    the float used to create the complex number

  36. def fromInt(n: Int): Complex

    Create a complex number from an Int.

    Create a complex number from an Int.

    n

    the integer used to create the complex number

    Definition Classes
    Complex → Numeric
  37. def fromLong(n: Long): Complex

    Create a complex number from a Long.

    Create a complex number from a Long.

    n

    the long used to create the complex number

  38. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  39. def gt(x: Complex, y: Complex): Boolean

    Definition Classes
    Ordering → PartialOrdering
  40. def gteq(x: Complex, y: Complex): Boolean

    Definition Classes
    Ordering → PartialOrdering
  41. def hashCode(): Int

    Must also override hashCode to be be compatible with equals.

    Must also override hashCode to be be compatible with equals.

    Definition Classes
    Complex → AnyRef → Any
  42. val im: Double

    the imaginary part

  43. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  44. def isRe: Boolean

    Determine whether this complex number is real (no imaginary part).

  45. def lt(x: Complex, y: Complex): Boolean

    Definition Classes
    Ordering → PartialOrdering
  46. def lteq(x: Complex, y: Complex): Boolean

    Definition Classes
    Ordering → PartialOrdering
  47. def max(c: Complex): Complex

    Return the maximum of this and that complex numbers.

    Return the maximum of this and that complex numbers.

    c

    that complex number to compare with this

  48. def max(x: Complex, y: Complex): Complex

    Definition Classes
    Ordering
  49. def min(c: Complex): Complex

    Return the minimum of this and that complex numbers.

    Return the minimum of this and that complex numbers.

    c

    that complex number to compare with this

  50. def min(x: Complex, y: Complex): Complex

    Definition Classes
    Ordering
  51. def minus(c: Complex, r: Double): Complex

  52. def minus(c: Complex, d: Complex): Complex

    Definition Classes
    Complex → Numeric
  53. implicit def mkNumericOps(lhs: Complex): FractionalOps

    Definition Classes
    Fractional → Numeric
  54. implicit def mkOrderingOps(lhs: Complex): Ops

    Definition Classes
    Ordering
  55. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  56. def negate(c: Complex): Complex

    Definition Classes
    Complex → Numeric
  57. final def notify(): Unit

    Definition Classes
    AnyRef
  58. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  59. def on[U](f: (U) ⇒ Complex): Ordering[U]

    Definition Classes
    Ordering
  60. def one: Complex

    Definition Classes
    Numeric
  61. def plus(c: Complex, r: Double): Complex

  62. def plus(c: Complex, d: Complex): Complex

    Definition Classes
    Complex → Numeric
  63. def polar: (Double, Double)

    Return the complex number in polar coordinates (radius, angle).

  64. def pow(c: Complex, r: Double): Complex

  65. def productArity: Int

    Definition Classes
    Complex → Product
  66. def productElement(arg0: Int): Any

    Definition Classes
    Complex → Product
  67. def productIterator: Iterator[Any]

    Definition Classes
    Product
  68. def productPrefix: String

    Definition Classes
    Complex → Product
  69. def radius: Double

    Return the radius of the complex number as a vector in the re-im plane.

  70. val re: Double

    the real part

  71. def reverse: Ordering[Complex]

    Definition Classes
    Ordering → PartialOrdering
  72. def signum(x: Complex): Int

    Definition Classes
    Numeric
  73. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  74. def times(c: Complex, r: Double): Complex

  75. def times(c: Complex, d: Complex): Complex

    Definition Classes
    Complex → Numeric
  76. def toDouble: Double

  77. def toDouble(c: Complex): Double

    Convert that/this complex number to a Double.

    Convert that/this complex number to a Double.

    Definition Classes
    Complex → Numeric
  78. def toFloat: Float

  79. def toFloat(c: Complex): Float

    Convert that/this complex number to a Float.

    Convert that/this complex number to a Float.

    Definition Classes
    Complex → Numeric
  80. def toInt: Int

  81. def toInt(c: Complex): Int

    Convert that/this complex number to an Int.

    Convert that/this complex number to an Int.

    Definition Classes
    Complex → Numeric
  82. def toLong: Long

  83. def toLong(c: Complex): Long

    Convert this complex number to a Long.

    Convert this complex number to a Long.

    Definition Classes
    Complex → Numeric
  84. def toString(): String

    Convert this complex number to a String.

    Convert this complex number to a String.

    Definition Classes
    Complex → AnyRef → Any
  85. def tryCompare(x: Complex, y: Complex): Some[Int]

    Definition Classes
    Ordering → PartialOrdering
  86. def unary_-(): Complex

    Compute the unary minus (-).

  87. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  88. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  89. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  90. def zero: Complex

    Definition Classes
    Numeric
  91. def ~^(r: Double): Complex

    Raise a complex to the r-th power (a double) using polar coordinates.

    Raise a complex to the r-th power (a double) using polar coordinates.

    r

    the power/exponent

Deprecated Value Members

  1. def productElements: Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    (Since version 2.8.0) use productIterator instead

Inherited from Product

Inherited from Equals

Inherited from Ordered[Complex]

Inherited from Comparable[Complex]

Inherited from Fractional[Complex]

Inherited from Numeric[Complex]

Inherited from Ordering[Complex]

Inherited from Serializable

Inherited from Serializable

Inherited from PartialOrdering[Complex]

Inherited from Equiv[Complex]

Inherited from Comparator[Complex]

Inherited from AnyRef

Inherited from Any