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:
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.
(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.
(acos z)
Calculate the complex arc cosine
Calculate the complex arc cosine
(acosh z)
Compute the complex arc hyperbolic cosine
Compute the complex arc hyperbolic cosine
(acot z)
Calculate the complex arc cotangent.
Calculate the complex arc cotangent.
(acoth z)
Calculate the complex arc hyperbolic cotangent.
Calculate the complex arc hyperbolic cotangent.
(acsc z)
Compute the complex arc cosecant.
Compute the complex arc cosecant.
(acsch z)
Calculate the complex arc hyperbolic cosecant.
Calculate the complex arc hyperbolic cosecant.
(arg z)
Calculate the angle of the complex number.
Calculate the angle of the complex number.
(asec z)
Calculate the complex arc secant.
Calculate the complex arc secant.
(asech z)
Calculate the complex arc hyperbolic secant.
Calculate the complex arc hyperbolic secant.
(asinh z)
Calculate the arc hyperbolic sine.
Calculate the arc hyperbolic sine.
(atan z)
Calculate the complex arctangent
Calculate the complex arctangent
(atanh z)
Calculate the complex hyperbolic tangent.
Calculate the complex hyperbolic tangent.
(ceil z)
(ceil z places)
Ceils the actual complex number
Ceils the actual complex number
(conjugate z)
Returns the complex conjugate
Returns the complex conjugate
(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.
(cosh z)
Calculate the complex hyperbolic cosine
Calculate the complex hyperbolic cosine
(coth z)
Calculate the complex hyperbolic cotangent
Calculate the complex hyperbolic cotangent
(csch z)
Compute the complex hyperbolic cosecant.
Compute the complex hyperbolic cosecant.
(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.
(exp z)
Calculate the complex exponential.
Calculate the complex exponential.
(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.
(floor z)
(floor z places)
Floors the actual complex number
Floors the actual complex number
(inverse z)
Calculate the complex inverse 1/z
Calculate the complex inverse 1/z
(log z)
Calculate complex the natural log.
Calculate complex the natural log.
(nan? z)
Determines whether a complex number is not on the Riemann sphere.
Determines whether a complex number is not on the Riemann sphere.
(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
(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)
(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.
(sech z)
Calculate the complex hyperbolic secant.
Calculate the complex hyperbolic secant.
(sinh z)
Calculate the complex hyperbolic sine
Calculate the complex hyperbolic sine
(sqrt z)
Calculate the complex square root
Calculate the complex square root
(sub l r)
Compute the complex difference.
Compute the complex difference.
(tanh z)
Caclulate the complex hyperbolic tangent
Caclulate the complex hyperbolic tangent
(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
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close