Documentation
¶
Overview ¶
Package dualcmplx provides the anti-commutative dual complex numeric type and functions.
See https://arxiv.org/abs/1601.01754v1 for details.
Example ¶
Output: square: 0 {x:0 y:0} -> {x:-4 y:3} 1 {x:0 y:1} -> {x:-5 y:3} 2 {x:1 y:0} -> {x:-4 y:4} 3 {x:1 y:1} -> {x:-5 y:4} line segment: 0 {x:2 y:2} -> {x:2 y:2} 1 {x:2 y:3} -> {x:1 y:2}
Index ¶
- func Abs(d Number) float64
- type Number
- func Add(x, y Number) Number
- func Conj(d Number) Number
- func Exp(d Number) Number
- func Inv(d Number) Number
- func Log(d Number) Number
- func Mul(x, y Number) Number
- func Pow(d, p Number) Number
- func PowReal(d Number, p float64) Number
- func Scale(f float64, d Number) Number
- func Sqrt(d Number) Number
- func Sub(x, y Number) Number
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Number ¶
type Number struct {
Real, Dual complex128
}
Number is a float64 precision anti-commutative dual complex number.
func Exp ¶
Exp returns e**q, the base-e exponential of d.
Special cases are:
Exp(+Inf) = +Inf Exp(NaN) = NaN
Very large values overflow to 0 or +Inf. Very small values underflow to 1.
func Log ¶
Log returns the natural logarithm of d.
Special cases are:
Log(+Inf) = (+Inf+0ϵ) Log(0) = (-Inf±Infϵ) Log(x < 0) = NaN Log(NaN) = NaN
func PowReal ¶
PowReal returns d**p, the base-d exponential of p.
Special cases are (in order):
PowReal(NaN+xϵ, ±0) = 1+NaNϵ for any x Pow(0+xϵ, y) = 0+Infϵ for all y < 1. Pow(0+xϵ, y) = 0 for all y > 1. PowReal(x, ±0) = 1 for any x PowReal(1+xϵ, y) = 1+xyϵ for any y Pow(Inf, y) = +Inf+NaNϵ for y > 0 Pow(Inf, y) = +0+NaNϵ for y < 0 PowReal(x, 1) = x for any x PowReal(NaN+xϵ, y) = NaN+NaNϵ PowReal(x, NaN) = NaN+NaNϵ PowReal(-1, ±Inf) = 1 PowReal(x+0ϵ, +Inf) = +Inf+NaNϵ for |x| > 1 PowReal(x+yϵ, +Inf) = +Inf for |x| > 1 PowReal(x, -Inf) = +0+NaNϵ for |x| > 1 PowReal(x, +Inf) = +0+NaNϵ for |x| < 1 PowReal(x+0ϵ, -Inf) = +Inf+NaNϵ for |x| < 1 PowReal(x, -Inf) = +Inf-Infϵ for |x| < 1 PowReal(+Inf, y) = +Inf for y > 0 PowReal(+Inf, y) = +0 for y < 0 PowReal(-Inf, y) = Pow(-0, -y)