Liking cljdoc? Tell your friends :D

emmy.complex.impl

This namespace provides the primitive implementation of complex arithmetic for Emmy. The authors are indebted to Robert Eisele's Complex.js implementation from which we have borrowed freely and which is licensed as follows:

  • Copyright (c) 2020, Robert Eisele (robert@xarg.org)
  • Dual licensed under the MIT or GPL Version 2 licenses.
This namespace provides the primitive implementation of complex
arithmetic for Emmy. The authors are indebted to Robert Eisele's
`Complex.js` implementation from which we have borrowed freely and
which is licensed as follows:

* Copyright (c) 2020, Robert Eisele (robert@xarg.org)
* Dual licensed under the MIT or GPL Version 2 licenses.
raw docstring

-Iclj/s

source

absclj/s

(abs z)

Calculate the magnitude of the complex number. The implementation tactic used here (pre-dividing by the greater of the components) comes from the GNU ISO C++ standard library.

Calculate the magnitude of the complex number.
The implementation tactic used here (pre-dividing by the greater
of the components) comes from the GNU ISO C++ standard library.
sourceraw docstring

acosclj/s

(acos z)

Calculate the complex arc cosine

Calculate the complex arc cosine
sourceraw docstring

acoshclj/s

(acosh z)

Compute the complex arc hyperbolic cosine

Compute the complex arc hyperbolic cosine
sourceraw docstring

acotclj/s

(acot z)

Calculate the complex arc cotangent.

Calculate the complex arc cotangent.
sourceraw docstring

acothclj/s

(acoth z)

Calculate the complex arc hyperbolic cotangent.

Calculate the complex arc hyperbolic cotangent.
sourceraw docstring

acscclj/s

(acsc z)

Compute the complex arc cosecant.

Compute the complex arc cosecant.
sourceraw docstring

acschclj/s

(acsch z)

Calculate the complex arc hyperbolic cosecant.

Calculate the complex arc hyperbolic cosecant.
sourceraw docstring

addclj/s

(add l r)

Compute the complex sum.

Compute the complex sum.
sourceraw docstring

argclj/s

(arg z)

Calculate the angle of the complex number.

Calculate the angle of the complex number.
sourceraw docstring

asecclj/s

(asec z)

Calculate the complex arc secant.

Calculate the complex arc secant.
sourceraw docstring

asechclj/s

(asech z)

Calculate the complex arc hyperbolic secant.

Calculate the complex arc hyperbolic secant.
sourceraw docstring

asinclj/s

(asin z)

Calculate the complex arc sine

Calculate the complex arc sine
sourceraw docstring

asinhclj/s

(asinh z)

Calculate the arc hyperbolic sine.

Calculate the arc hyperbolic sine.
sourceraw docstring

atanclj/s

(atan z)

Calculate the complex arctangent

Calculate the complex arctangent
sourceraw docstring

atanhclj/s

(atanh z)

Calculate the complex hyperbolic tangent.

Calculate the complex hyperbolic tangent.
sourceraw docstring

ceilclj/s

(ceil z)
(ceil z places)

Ceils the actual complex number

Ceils the actual complex number
sourceraw docstring

conjugateclj/s

(conjugate z)

Returns the complex conjugate

Returns the complex conjugate
sourceraw docstring

cosclj/s

(cos z)
source

cos-1clj/s

(cos-1 x)

Computes $\cos(x)-1$ using Taylor series if $|x|\le{\pi\over 4}$), otherwise just subtracts one from (Math/cos x). Doing the latter when x is small squanders significant digits.

Computes $\cos(x)-1$ using Taylor series if $|x|\le{\pi\over 4}$),
otherwise just subtracts one from `(Math/cos x)`. Doing the latter
when x is small squanders significant digits.
sourceraw docstring

coshclj/s

(cosh z)

Calculate the complex hyperbolic cosine

Calculate the complex hyperbolic cosine
sourceraw docstring

cotclj/s

(cot z)
source

cothclj/s

(coth z)

Calculate the complex hyperbolic cotangent

Calculate the complex hyperbolic cotangent
sourceraw docstring

cscclj/s

(csc z)
source

cschclj/s

(csch z)

Compute the complex hyperbolic cosecant.

Compute the complex hyperbolic cosecant.
sourceraw docstring

divclj/s

(div l r)

Compute the complex quotient.

Compute the complex quotient.
sourceraw docstring

equal?clj/s

(equal? z w)

Returns true if the supplied complex number z is equal to the value w. The rules for [[eq]] are as follows:

  • If w is complex, returns true if all coefficients match, false otherwise

  • If w is sequential with a count of 2, it's interpreted as complex in the obvious way

Else, if z is a [[real?]] complex number, returns true if the real component of z is emmy.value/= to w, false otherwise.

Returns true if the supplied complex number `z` is equal to the value `w`. The
rules for [[eq]] are as follows:

 - If `w` is complex, returns true if all coefficients match, false
   otherwise

 - If `w` is sequential with a count of 2, it's interpreted as complex in the
   obvious way

Else, if `z` is a [[real?]] complex number, returns true if the real component of
`z` is [[emmy.value/=]] to `w`, false otherwise.
sourceraw docstring

expclj/s

(exp z)

Calculate the complex exponential.

Calculate the complex exponential.
sourceraw docstring

exp-1clj/s

(exp-1 z)

Calculate the complex exponent and subtracts one. This may be more accurate than (- (exp z) 1) if z is small.

Calculate the complex exponent and subtracts one.
This may be more accurate than `(- (exp z) 1)` if
`z` is small.
sourceraw docstring

floorclj/s

(floor z)
(floor z places)

Floors the actual complex number

Floors the actual complex number
sourceraw docstring

Iclj/s

source

imaginaryclj/s

(imaginary z)
source

INFINITYclj/s

source

inverseclj/s

(inverse z)

Calculate the complex inverse 1/z

Calculate the complex inverse 1/z
sourceraw docstring

LN2clj/s

source

logclj/s

(log z)

Calculate complex the natural log.

Calculate complex the natural log.
sourceraw docstring

mulclj/s

(mul l r)

Compute the complex product.

Compute the complex product.
sourceraw docstring

NANclj/s

source

nan?clj/s

(nan? z)

Determines whether a complex number is not on the Riemann sphere.

Determines whether a complex number is not on the Riemann sphere.
sourceraw docstring

negclj/s

(neg z)

Gets the negated complex number

Gets the negated complex number
sourceraw docstring

ONEclj/s

source

one-likeclj/s

(one-like c)

Constructs an identity-like complex number of the same kind as the example

Constructs an identity-like complex number of the same kind as the example
sourceraw docstring

parseclj/s

(parse s)

Parse a complex number. We expect one or two floating point numbers. If two, they must be separated by a sign (perhaps surrounded by at most one space, the second number followed by I or i. Example: 1.2-3.4i)

Parse a complex number. We expect one or two floating point numbers.
If two, they must be separated by a sign (perhaps surrounded by at most
one space, the second number followed by I or i. Example: 1.2-3.4i)
sourceraw docstring

powclj/s

(pow l r)

Calculate the power of two complex numbers. 0 to any power is zero, unless that power has an imaginary component, in which case NaN. Integral powers of the imaginary unit are treated exactly; everything else uses logarithms.

Calculate the power of two complex numbers. 0 to any power is
zero, unless that power has an imaginary component, in which case NaN.
Integral powers of the imaginary unit are treated exactly; everything
else uses logarithms.
sourceraw docstring

realclj/s

(real z)
source

secclj/s

(sec z)
source

sechclj/s

(sech z)

Calculate the complex hyperbolic secant.

Calculate the complex hyperbolic secant.
sourceraw docstring

sinclj/s

(sin z)

Calculate the complex sine.

Calculate the complex sine.
sourceraw docstring

sinhclj/s

(sinh z)

Calculate the complex hyperbolic sine

Calculate the complex hyperbolic sine
sourceraw docstring

sqrtclj/s

(sqrt z)

Calculate the complex square root

Calculate the complex square root
sourceraw docstring

subclj/s

(sub l r)

Compute the complex difference.

Compute the complex difference.
sourceraw docstring

tanclj/s

(tan z)
source

tanhclj/s

(tanh z)

Caclulate the complex hyperbolic tangent

Caclulate the complex hyperbolic tangent
sourceraw docstring

ZEROclj/s

source

zero-likeclj/s

(zero-like c)

Constructs an identity-like complex number of the same kind as the example

Constructs an identity-like complex number of the same kind as the example
sourceraw docstring

zero?clj/s

(zero? z)

Determines whether or not a complex number is at the zero pole of the Riemann sphere.

Determines whether or not a complex number is at the zero pole of the
Riemann sphere.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close