Class Complex

java.lang.Object
hoverball.math.Complex

public final class Complex
extends java.lang.Object
Die Klasse Complex repräsentiert eine komplexe Zahl der zweidimensionalen komplexen Zahlenebene.

Im Folgenden bedeuten:
    a, b, c  -  komplexe Zahlen
    x, y, z  -  reelle Zahlen (als Koordinaten)
    r  -  reelle Zahl
    v  -  Vektor
    c  -  die komplexe Zahl des Complex-Objekts selbst

Operator Overloading für Groovy, Scala, Kotlin und Jython wird unterstützt.

  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.text.DecimalFormat format
    DecimalFormat-Objekt zur String-Konvertierung.
    double x
    x-Koordinate der komplexen Zahl.
    double y
    y-Koordinate der komplexen Zahl.
  • Constructor Summary

    Constructors 
    Constructor Description
    Complex()
    Erzeugt eine komplexe Zahl mit den Koordinaten (0,0).
    Complex​(double x)
    Erzeugt eine komplexe Zahl mit den Koordinaten (x,0).
    Complex​(double x, double y)
    Erzeugt eine komplexe Zahl mit den Koordinaten (x,y).
    Complex​(Complex c)
    Erzeugt eine komplexe Zahl gleich einer anderen komplexen Zahl.
    Complex​(Vector v)
    Erzeugt eine komplexe Zahl aus einem Vektor.
  • Method Summary

    Modifier and Type Method Description
    double abs()
    Berechnet den Absolutbetrag  [ = | c | ].
    double abs2()
    Berechnet den Absolutbetrag im Quadrat  [ = | c |^2 ].
    Complex add​(Complex b)
    Addiert eine komplexe Zahl  [ c = c + b ].
    static Complex add​(Complex a, Complex b)
    Addiert zwei komplexe Zahlen  [ = a + b ].
    double arg()
    Berechnet das Argument  [ = <(c) ].
    Complex conj()
    Bildet die Konjugation  [ c = c ].
    static Complex conj​(Complex c)
    Berechnet die Konjugation  [ = c ].
    Complex div​(double r)
    Dividiert durch eine reelle Zahl  [ c = c / r ].
    Complex div​(Complex b)
    Dividiert durch eine komplexe Zahl  [ c = c / b ].
    static double dot​(Complex a, Complex b)
    Berechnet das Skalarprodukt zweier komplexer Zahlen  [ = < a, b > ].
    boolean equals​(double x, double y)
    Vergleicht mit einer komplexen Zahl  [ c = (x,y) ?
    boolean equals​(java.lang.Object c)
    Vergleicht mit einer komplexen Zahl  [ c = c ?
    static Complex exp​(Complex a)
    Berechnet den komplexen Exponentialwert  [ = exp a ].
    static Complex expi​(double y)
    Berechnet den komplexen Exponentialwert  [ = exp iy ].
    int hashCode()
    Berechnet den Hash-Code  [ = #### ].
    Complex inv()
    Bildet die Kehrzahl  [ c = 1 / c ].
    static Complex inv​(Complex c)
    Berechnet die Kehrzahl  [ = 1 / c ].
    Complex mul​(double r)
    Multipliziert mit einer reellen Zahl  [ c = c r ].
    Complex mul​(Complex b)
    Multipliziert mit einer komplexen Zahl  [ c = c b ].
    static Complex mul​(Complex c, double r)
    Multipliziert eine komplexe Zahl mit einer reellen Zahl  [ = c r ].
    static Complex mul​(Complex a, Complex b)
    Multipliziert zwei komplexe Zahlen  [ = a b ].
    Complex neg()
    Bildet die Gegenzahl  [ c = -c ].
    static Complex neg​(Complex c)
    Berechnet die Gegenzahl  [ = -c ].
    Complex norm()
    Normiert den Absolutbetrag auf eins  [ c = c / | c | ].
    static Complex norm​(Complex c)
    Berechnet die Normierung des Absolutbetrages auf eins  [ = c / | c | ].
    Complex sub​(Complex b)
    Subtrahiert eine komplexe Zahl  [ c = c - b ].
    static Complex sub​(Complex a, Complex b)
    Subtrahiert zwei komplexe Zahlen  [ = a - b ].
    java.lang.String toString()
    String-Repräsentation  [ = "..." ].
    static Complex vec​(double a_z, Complex b)
    Berechnet das dreidimensionale Vektorprodukt zweier Vektoren  [ = a x b ].
    static double vec​(Complex a, Complex b)
    Berechnet das dreidimensionale Vektorprodukt zweier Vektoren  [ = a x b ].
    boolean zero()
    Testet auf null  [ c = 0 ?

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • format

      public static java.text.DecimalFormat format
      DecimalFormat-Objekt zur String-Konvertierung.

      Dieses Objekt wird zur Formatierung aller Objekte dieses Packages benutzt. Voreingestellt ist das Format 0.### mit Locale.US.

    • x

      public final double x
      x-Koordinate der komplexen Zahl.
    • y

      public final double y
      y-Koordinate der komplexen Zahl.
  • Constructor Details

    • Complex

      public Complex()
      Erzeugt eine komplexe Zahl mit den Koordinaten (0,0).
    • Complex

      public Complex​(double x, double y)
      Erzeugt eine komplexe Zahl mit den Koordinaten (x,y).
      Parameters:
      x - x-Koordinate
      y - y-Koordinate
    • Complex

      public Complex​(double x)
      Erzeugt eine komplexe Zahl mit den Koordinaten (x,0).
      Parameters:
      x - x-Koordinate
    • Complex

      public Complex​(Complex c)
      Erzeugt eine komplexe Zahl gleich einer anderen komplexen Zahl.
      Parameters:
      c - zu kopierende komplexe Zahl
    • Complex

      public Complex​(Vector v)
      Erzeugt eine komplexe Zahl aus einem Vektor.

      Die z-Koordinate des Vektors wird dabei ignoriert.

      Parameters:
      v - Vektor
  • Method Details

    • hashCode

      public int hashCode()
      Berechnet den Hash-Code  [ = #### ].
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      den Hash-Code
    • toString

      public java.lang.String toString()
      String-Repräsentation  [ = "..." ].
      Overrides:
      toString in class java.lang.Object
      Returns:
      den String
    • equals

      public boolean equals​(java.lang.Object c)
      Vergleicht mit einer komplexen Zahl  [ c = c ? ].
      Overrides:
      equals in class java.lang.Object
      Parameters:
      c - komplexe Zahl
      Returns:
      die Gleichheit
    • equals

      public boolean equals​(double x, double y)
      Vergleicht mit einer komplexen Zahl  [ c = (x,y) ? ].
      Parameters:
      x - reelle Zahl
      y - reelle Zahl
      Returns:
      die Gleichheit
    • add

      public final Complex add​(Complex b)
      Addiert eine komplexe Zahl  [ c = c + b ].
      Parameters:
      b - komplexe Zahl
      Returns:
      this
    • sub

      public final Complex sub​(Complex b)
      Subtrahiert eine komplexe Zahl  [ c = c - b ].
      Parameters:
      b - komplexe Zahl
      Returns:
      this
    • mul

      public final Complex mul​(double r)
      Multipliziert mit einer reellen Zahl  [ c = c r ].
      Parameters:
      r - reelle Zahl
      Returns:
      this
    • mul

      public final Complex mul​(Complex b)
      Multipliziert mit einer komplexen Zahl  [ c = c b ].
      Parameters:
      b - komplexe Zahl
      Returns:
      this
    • div

      public final Complex div​(double r)
      Dividiert durch eine reelle Zahl  [ c = c / r ].
      Parameters:
      r - reelle Zahl
      Returns:
      this
    • div

      public final Complex div​(Complex b)
      Dividiert durch eine komplexe Zahl  [ c = c / b ].
      Parameters:
      b - komplexe Zahl
      Returns:
      this
    • inv

      public final Complex inv()
      Bildet die Kehrzahl  [ c = 1 / c ].
      Returns:
      this
    • neg

      public final Complex neg()
      Bildet die Gegenzahl  [ c = -c ].
      Returns:
      this
    • conj

      public final Complex conj()
      Bildet die Konjugation  [ c = c ].
      Returns:
      this
    • zero

      public final boolean zero()
      Testet auf null  [ c = 0 ? ].
      Returns:
      true, falls diese komplexe Zahl gleich (0,0)
    • arg

      public final double arg()
      Berechnet das Argument  [ = <(c) ]. Ist die komplexe Zahl gleich null, liefert diese Funktion den Wert null.
      Returns:
      das Argument
    • abs

      public final double abs()
      Berechnet den Absolutbetrag  [ = | c | ].
      Returns:
      den Absolutbetrag
    • abs2

      public final double abs2()
      Berechnet den Absolutbetrag im Quadrat  [ = | c |^2 ].
      Returns:
      den Absolutbetrag im Quadrat
    • norm

      public final Complex norm()
      Normiert den Absolutbetrag auf eins  [ c = c / | c | ].
      Returns:
      this
    • add

      public static final Complex add​(Complex a, Complex b)
      Addiert zwei komplexe Zahlen  [ = a + b ].
      Parameters:
      a - komplexe Zahl
      b - komplexe Zahl
      Returns:
      die Summe
    • sub

      public static final Complex sub​(Complex a, Complex b)
      Subtrahiert zwei komplexe Zahlen  [ = a - b ].
      Parameters:
      a - komplexe Zahl
      b - komplexe Zahl
      Returns:
      die Differenz
    • neg

      public static final Complex neg​(Complex c)
      Berechnet die Gegenzahl  [ = -c ].
      Parameters:
      c - komplexe Zahl
      Returns:
      die Gegenzahl
    • inv

      public static final Complex inv​(Complex c)
      Berechnet die Kehrzahl  [ = 1 / c ].
      Parameters:
      c - komplexe Zahl
      Returns:
      die Kehrzahl
    • conj

      public static final Complex conj​(Complex c)
      Berechnet die Konjugation  [ = c ].
      Parameters:
      c - komplexe Zahl
      Returns:
      die Konjugation
    • norm

      public static final Complex norm​(Complex c)
      Berechnet die Normierung des Absolutbetrages auf eins  [ = c / | c | ].
      Parameters:
      c - komplexe Zahl
      Returns:
      die Normierung
    • mul

      public static final Complex mul​(Complex c, double r)
      Multipliziert eine komplexe Zahl mit einer reellen Zahl  [ = c r ].
      Parameters:
      c - komplexe Zahl
      r - reelle Zahl
      Returns:
      das Produkt
    • mul

      public static final Complex mul​(Complex a, Complex b)
      Multipliziert zwei komplexe Zahlen  [ = a b ].
      Parameters:
      a - komplexe Zahl
      b - komplexe Zahl
      Returns:
      das Produkt
    • dot

      public static final double dot​(Complex a, Complex b)
      Berechnet das Skalarprodukt zweier komplexer Zahlen  [ = < a, b > ].
      Parameters:
      a - komplexe Zahl
      b - komplexe Zahl
      Returns:
      das Skalarprodukt
    • vec

      public static final double vec​(Complex a, Complex b)
      Berechnet das dreidimensionale Vektorprodukt zweier Vektoren  [ = a x b ].

      Formel:   (a.x, a.y, 0) x (b.x, b.y, 0) = (0, 0, c.z)

      Parameters:
      a - komplexe Zahl
      b - komplexe Zahl
      Returns:
      die z-Koordinate des Vektorprodukts
    • vec

      public static final Complex vec​(double a_z, Complex b)
      Berechnet das dreidimensionale Vektorprodukt zweier Vektoren  [ = a x b ].

      Formel:   (0, 0, a.z) x (b.x, b.y, 0) = (c.x, c.y, 0)

      Parameters:
      a_z - reelle Zahl
      b - komplexe Zahl
      Returns:
      die (x,y)-Koordinaten des Vektorprodukts
    • expi

      public static final Complex expi​(double y)
      Berechnet den komplexen Exponentialwert  [ = exp iy ].
      Parameters:
      y - reelle Zahl
      Returns:
      den Exponentialwert
    • exp

      public static final Complex exp​(Complex a)
      Berechnet den komplexen Exponentialwert  [ = exp a ].
      Parameters:
      a - komplexe Zahl
      Returns:
      den Exponentialwert