MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / acos

Method acos

src/org/opensourcephysics/numerics/Complex.java:617–634  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

615 }
616
617 public Complex acos() {
618 Complex result;
619 double tempRe, tempIm;
620 // acos(z) = -i * log( z + i * sqrt(1 - z*z) )
621 tempRe = 1.0-((re*re)-(im*im));
622 tempIm = 0.0-((re*im)+(im*re));
623 result = new Complex(tempRe, tempIm);
624 result = result.sqrt();
625 tempRe = -result.im;
626 tempIm = result.re;
627 result.re = re+tempRe;
628 result.im = im+tempIm;
629 tempRe = Math.log(result.abs());
630 tempIm = result.arg();
631 result.re = tempIm;
632 result.im = -tempRe;
633 return result;
634 }
635
636 public Complex atan() {
637 // atan(z) = -i/2 * log((i-z)/(i+z))

Callers 7

builtInFunctionMethod · 0.80
isNonLeftMethod · 0.80
builtInFunctionMethod · 0.80
angleMethod · 0.80
cubicMethod · 0.80
angleMethod · 0.80

Calls 4

sqrtMethod · 0.95
absMethod · 0.95
argMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected