JavaView® v2.00.008

jv.number
Class PuComplex

java.lang.Object
  |
  +--jv.number.PuComplex
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class PuComplex
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Complex number and basic complex functions. Here is a listing with all implemented functions.

  set(re, im)        u=(re,im)       with u PuComplex, re, im double
  copy(v)            u=(v.re,v.im)   with u PuComplex, v PuComplex
  add(u,v)           w=u+v           with u PuComplex, v PuComplex or double
  u.add(v)           u+=v            with u PuComplex, v PuComplex or double
  sub(u,v)           w=u-v           with u PuComplex, v PuComplex or double
  u.sub(v)           u-=v            with u PuComplex, v PuComplex or double
  mult(u.v)          w=u*v           with u PuComplex, v PuComplex or double
  u.mult(v)          u*=v            with u PuComplex, v PuComplex or double
  div(u,v)           w=u/v           with u PuComplex, v PuComplex or double
  u.div(v)           u/=v            with u PuComplex, v PuComplex or double
  sqr(u)             w=u*u           with u PuComplex
  u.sqr()            u=u*u           with u PuComplex
  cube(u)            w=u*u*u         with u PuComplex
  u.cube()           u=u*u*u         with u PuComplex
  abs(u)             r=|u|           with u PuComplex
  u.abs()            r=|u|           with u PuComplex
  u.sqrAbs()         r=|u|^2         with u PuComplex
  inv(u)             w=1/u           with u PuComplex
  u.inv()            u=1/u           with u PuComplex
  re(u)              r=re(u)         with u PuComplex
  im(u)              r=im(u)         with u PuComplex
  conj(u)            w=re(u)-i*im(u) with u PuComplex
  u.conj()           u=re(u)-i*im(u) with u PuComplex
  neg(u)             w=-u            with u PuComplex
  u.neg()            u=-u            with u PuComplex
  arg(u)             r=arg(u)        with u PuComplex
  u.arg()            r=arg(u)        with u PuComplex
  polarToRect(r,f)   w=r*exp(i*f)    with r double, f double
  exp(u)             w=exp(u)        with u PuComplex
  u.exp()            u=exp(u)        with u PuComplex
  log(u)             w=log(u)        with u PuComplex
  u.log()            u=log(u)        with u PuComplex
  sqrt(u)            w=sqrt(u)       with u PuComplex, result with im >= 0.
  u.sqrt()           u=sqrt(u)       with u PuComplex, result with im >= 0.
  pow(u,v)           w=u**v          with u PuComplex, v PuComplex or double
  sin(u)             w=sin(u)        with u PuComplex
  cos(u)             w=cos(u)        with u PuComplex
  sinh(u)            w=sinh(u)       with u PuComplex
  cosh(u)            w=cosh(u)       with u PuComplex
 

Version:
26.09.99, 2.20 revised (kp) Methods set and copy added. Now most methods return 'this'.
14.06.99, 2.10 revised (kp) isNaN and others added. In case of error function now return NaN etc.
00.05.99, 2.00 revised (ur) Converted to Java and revisions.
29.06.98, 1.00 created (kp)
Author:
Konrad Polthier and Ulrich Reitebuch
See Also:
Serialized Form

Field Summary
static PuComplex I
           
 double im
           
static PuComplex NEG_I
           
static PuComplex NEG_ONE
           
static PuComplex ONE
           
static PuComplex PI_OVER_4
           
static PuComplex PI3_OVER_4
           
static PuComplex PI5_OVER_4
           
static PuComplex PI7_OVER_4
           
 double re
           
static PuComplex ZERO
           
 
Constructor Summary
PuComplex()
           
PuComplex(double aReal)
           
PuComplex(double aReal, double aImag)
           
PuComplex(PuComplex u)
           
 
Method Summary
 double abs()
          r = |u|
static double abs(PuComplex u)
          r = |u|
 PuComplex add(double v)
          u += r.
 PuComplex add(PuComplex v)
          u += v
static PuComplex add(PuComplex u, double v)
          w = u + r.
static PuComplex add(PuComplex u, PuComplex v)
          w = u + v
 double arg()
          r = u.arg()
static double arg(PuComplex u)
          r = arg(u)
 PuComplex conj()
          u = Re(u) - Im(u)
static PuComplex conj(PuComplex u)
          w = Re(u) - Im(u)
 PuComplex copy(PuComplex v)
          u = (v.re, v.im)
static PuComplex cos(PuComplex u)
          w = cos(u)
static PuComplex cosh(PuComplex u)
          w = cosh(u)
 PuComplex cube()
          u = u**3.
static PuComplex cube(PuComplex u)
          w = u ** 3.
 PuComplex div(double r)
          u /= r In case of zero division the following result occurs: If |r|==0. and re==0 then re==Double.NaN.
 PuComplex div(PuComplex v)
          u /=v In case of zero division the following result occurs: If |v|==0. and re==0 then re==Double.NaN.
static PuComplex div(PuComplex u, double r)
          w = u / r In case of zero division the following result occurs: If |r|==0. and re==0 then re==Double.NaN.
static PuComplex div(PuComplex u, PuComplex v)
          w = u / v In case of zero division the following result occurs: If |v|==0. and u.re==0 then w.re==Double.NaN.
 boolean equals(PuComplex z, double tolerance)
           
 boolean equals(PuComplex w, PuComplex z, double tolerance)
           
 PuComplex exp()
          u = exp(u)
static PuComplex exp(PuComplex u)
          w = exp(u)
static double im(PuComplex u)
          r = Im(u)
 PuComplex inv()
          u = 1./u In case of |u|==0 the following result occurs: u.re = Double.POSITIVE_INFINITY, u.im = Double.POSITIVE_INFINITY.
static PuComplex inv(PuComplex u)
          w = 1./u In case of |u|==0 the following result occurs: w = PuComplex(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY)
 boolean isInfinite()
           
 boolean isNaN()
           
 PuComplex log()
          u = log(u)
static PuComplex log(PuComplex u)
          w = log(u)
 PuComplex mult(double v)
          u *= r.
 PuComplex mult(PuComplex v)
          u *= v
static PuComplex mult(PuComplex u, double v)
          w = u * r.
static PuComplex mult(PuComplex u, PuComplex v)
          w = u * v
 PuComplex neg()
          u = -u
static PuComplex neg(PuComplex u)
          w = -u
static PuComplex polarToRect(double r, double f)
          w = r*exp(i*phi)
static PuComplex pow(PuComplex u, double r)
          w = u**r.
static PuComplex pow(PuComplex u, PuComplex v)
          w = u**v
static double re(PuComplex u)
          r = Re(u)
 PuComplex set(double aReal, double aImag)
          u = (re, im)
static PuComplex sin(PuComplex u)
          w = sin(u)
static PuComplex sinh(PuComplex u)
          w = sinh(u)
 PuComplex sqr()
          u *=u
static PuComplex sqr(PuComplex u)
          w = u * u
 double sqrAbs()
          r = |u|^2
 PuComplex sqrt()
          u= sqrt(u)
static PuComplex sqrt(PuComplex u)
          w = sqrt(u)
 PuComplex sub(double v)
          u -= r.
 PuComplex sub(PuComplex v)
          u -= v
static PuComplex sub(PuComplex u, double v)
          w = u - r.
static PuComplex sub(PuComplex u, PuComplex v)
          w = u - v
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO

public static final PuComplex ZERO

ONE

public static final PuComplex ONE

I

public static final PuComplex I

NEG_ONE

public static final PuComplex NEG_ONE

NEG_I

public static final PuComplex NEG_I

PI_OVER_4

public static final PuComplex PI_OVER_4

PI3_OVER_4

public static final PuComplex PI3_OVER_4

PI5_OVER_4

public static final PuComplex PI5_OVER_4

PI7_OVER_4

public static final PuComplex PI7_OVER_4

re

public double re

im

public double im
Constructor Detail

PuComplex

public PuComplex()

PuComplex

public PuComplex(double aReal)

PuComplex

public PuComplex(PuComplex u)

PuComplex

public PuComplex(double aReal,
                 double aImag)
Method Detail

set

public PuComplex set(double aReal,
                     double aImag)
u = (re, im)

copy

public PuComplex copy(PuComplex v)
u = (v.re, v.im)

isInfinite

public boolean isInfinite()

isNaN

public boolean isNaN()

equals

public boolean equals(PuComplex w,
                      PuComplex z,
                      double tolerance)

equals

public boolean equals(PuComplex z,
                      double tolerance)

add

public static PuComplex add(PuComplex u,
                            PuComplex v)
w = u + v

add

public PuComplex add(PuComplex v)
u += v

add

public static PuComplex add(PuComplex u,
                            double v)
w = u + r.

add

public PuComplex add(double v)
u += r.

sub

public static PuComplex sub(PuComplex u,
                            PuComplex v)
w = u - v

sub

public PuComplex sub(PuComplex v)
u -= v

sub

public static PuComplex sub(PuComplex u,
                            double v)
w = u - r.

sub

public PuComplex sub(double v)
u -= r.

mult

public static PuComplex mult(PuComplex u,
                             PuComplex v)
w = u * v

mult

public PuComplex mult(PuComplex v)
u *= v

mult

public static PuComplex mult(PuComplex u,
                             double v)
w = u * r.

mult

public PuComplex mult(double v)
u *= r.

div

public static PuComplex div(PuComplex u,
                            PuComplex v)
w = u / v In case of zero division the following result occurs: If |v|==0. and u.re==0 then w.re==Double.NaN. If |v|==0. and u.re>0 then w.re==Double.POSITIVE_INFINITY. If |v|==0. and u.re<0 then w.re==Double.NEGATIVE_INFINITY. Same handling is taken for imaginary part of u.

div

public PuComplex div(PuComplex v)
u /=v In case of zero division the following result occurs: If |v|==0. and re==0 then re==Double.NaN. If |v|==0. and re>0 then re==Double.POSITIVE_INFINITY. If |v|==0. and re<0 then re==Double.NEGATIVE_INFINITY. Same handling is taken for imaginary part of 'this'.

div

public static PuComplex div(PuComplex u,
                            double r)
w = u / r In case of zero division the following result occurs: If |r|==0. and re==0 then re==Double.NaN. If |r|==0. and re>0 then re==Double.POSITIVE_INFINITY. If |r|==0. and re<0 then re==Double.NEGATIVE_INFINITY. Same handling is taken for imaginary part of 'this'.

div

public PuComplex div(double r)
u /= r In case of zero division the following result occurs: If |r|==0. and re==0 then re==Double.NaN. If |r|==0. and re>0 then re==Double.POSITIVE_INFINITY. If |r|==0. and re<0 then re==Double.NEGATIVE_INFINITY. Same handling is taken for imaginary part of 'this'.

sqr

public static PuComplex sqr(PuComplex u)
w = u * u

sqr

public PuComplex sqr()
u *=u

cube

public static PuComplex cube(PuComplex u)
w = u ** 3.

cube

public PuComplex cube()
u = u**3.

abs

public static double abs(PuComplex u)
r = |u|

abs

public double abs()
r = |u|

sqrAbs

public double sqrAbs()
r = |u|^2

inv

public static PuComplex inv(PuComplex u)
w = 1./u In case of |u|==0 the following result occurs: w = PuComplex(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY)

inv

public PuComplex inv()
u = 1./u In case of |u|==0 the following result occurs: u.re = Double.POSITIVE_INFINITY, u.im = Double.POSITIVE_INFINITY.

re

public static double re(PuComplex u)
r = Re(u)

im

public static double im(PuComplex u)
r = Im(u)

conj

public static PuComplex conj(PuComplex u)
w = Re(u) - Im(u)

conj

public PuComplex conj()
u = Re(u) - Im(u)

neg

public static PuComplex neg(PuComplex u)
w = -u

neg

public PuComplex neg()
u = -u

arg

public static double arg(PuComplex u)
r = arg(u)

arg

public double arg()
r = u.arg()

polarToRect

public static PuComplex polarToRect(double r,
                                    double f)
w = r*exp(i*phi)

exp

public static PuComplex exp(PuComplex u)
w = exp(u)

exp

public PuComplex exp()
u = exp(u)

log

public static PuComplex log(PuComplex u)
w = log(u)

log

public PuComplex log()
u = log(u)

sqrt

public static PuComplex sqrt(PuComplex u)
w = sqrt(u)

sqrt

public PuComplex sqrt()
u= sqrt(u)

pow

public static PuComplex pow(PuComplex u,
                            PuComplex v)
w = u**v

pow

public static PuComplex pow(PuComplex u,
                            double r)
w = u**r.

sin

public static PuComplex sin(PuComplex u)
w = sin(u)

cos

public static PuComplex cos(PuComplex u)
w = cos(u)

sinh

public static PuComplex sinh(PuComplex u)
w = sinh(u)

cosh

public static PuComplex cosh(PuComplex u)
w = cosh(u)

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.