julenum/num/dualquat
Package for dual-quaternion numbers.
Index
struct Quat
fn PowReal(mut *self, &q: *Quat, p: f64)
fn Pow(mut *self, &q: *Quat, &p: *Quat)
fn Sqrt(mut *self, &q: *Quat)
fn Exp(mut *self, &q: *Quat)
fn Log(mut *self, &q: *Quat)
fn Zero(*self): bool
fn Add(mut *self, &x: *Quat, &y: *Quat)
fn Sub(mut *self, &x: *Quat, &y: *Quat)
fn Mul(mut *self, &x: *Quat, &y: *Quat)
fn Scale(mut *self, &q: *Quat, k: f64)
fn Inv(mut *self, &q: *Quat)
fn Abs(*self): dual::Dual
fn Conj(mut *self, &q: *Quat)
fn ConjY(mut *self, &q: *Quat)
fn ConjQuat(mut *self, &q: *Quat)
Quat
struct Quat {
X: quat::Quat
Y: quat::Quat
}
Dual quaternion with floating-point precision.
PowReal
fn PowReal(mut *self, &q: *Quat, p: f64)
Sets self to q**p, the base-q exponential of p.
Special cases are (in order):
PowReal(NaN+xϵ, ±0) = 1+NaNϵ for any q
PowReal(q, ±0) = 1 for any q
PowReal(1+xϵ, p) = 1+xyϵ for any p
PowReal(q, 1) = q for any q
PowReal(NaN+xϵ, p) = NaN+NaNϵ
PowReal(q, NaN) = NaN+NaNϵ
PowReal(±0, p) = ±Inf for p an odd integer < 0
PowReal(±0, -Inf) = +Inf
PowReal(±0, +Inf) = +0
PowReal(±0, p) = +Inf for finite p < 0 and not an odd integer
PowReal(±0, p) = ±0 for p an odd integer > 0
PowReal(±0, p) = +0 for finite p > 0 and not an odd integer
PowReal(-1, ±Inf) = 1
PowReal(q+0ϵ, +Inf) = +Inf+NaNϵ for |q| > 1
PowReal(q+yϵ, +Inf) = +Inf for |q| > 1
PowReal(q, -Inf) = +0+NaNϵ for |q| > 1
PowReal(q, +Inf) = +0+NaNϵ for |q| < 1
PowReal(q+0ϵ, -Inf) = +Inf+NaNϵ for |q| < 1
PowReal(q, -Inf) = +Inf-Infϵ for |q| < 1
PowReal(+Inf, p) = +Inf for p > 0
PowReal(+Inf, p) = +0 for p < 0
PowReal(-Inf, p) = Pow(-0, -p)
Pow
fn Pow(mut *self, &q: *Quat, &p: *Quat)
Sets self to the product q**p, the base-q exponential of p.
Sqrt
fn Sqrt(mut *self, &q: *Quat)
Sets self to the square root of q
Special cases are:
Sqrt(+Inf) = +Inf
Sqrt(±0) = (±0+Infϵ)
Sqrt(x < 0) = NaN
Sqrt(NaN) = NaN
Exp
fn Exp(mut *self, &q: *Quat)
Sets self to e**q, the base-e exponential of q.
Special cases are:
Exp(+Inf) = +Inf
Exp(NaN) = NaN
Very large values overflow to 0 or +Inf. Very small values underflow to 1.
Log
fn Log(mut *self, &q: *Quat)
Sets self to the natural logarithm of q.
Special cases are:
Log(+Inf) = (+Inf+0ϵ)
Log(0) = (-Inf±Infϵ)
Log(x < 0) = NaN
Log(NaN) = NaN
Zero
fn Zero(*self): bool
Reports whether all fields of dual quaternion are zero.
Add
fn Add(mut *self, &x: *Quat, &y: *Quat)
Sets self to the sum x+y.
Sub
fn Sub(mut *self, &x: *Quat, &y: *Quat)
Sets self to the difference x-y.
Mul
fn Mul(mut *self, &x: *Quat, &y: *Quat)
Sets self to the product x*y.
Scale
fn Scale(mut *self, &q: *Quat, k: f64)
Sets self to q scaled by k.
Inv
fn Inv(mut *self, &q: *Quat)
Sets self to inverse of q.
Abs
fn Abs(*self): dual::Dual
Returns absolute value of dual quaternion.
Conj
fn Conj(mut *self, &q: *Quat)
Sets self to the dual quaternion conjugate of q₁+q₂ϵ, q̅₁-q̅₂ϵ.
ConjY
fn ConjY(mut *self, &q: *Quat)
Sets self to the dual conjugate of q₁+q₂ϵ, q₁-q₂ϵ.
ConjQuat
fn ConjQuat(mut *self, &q: *Quat)
Sets self to the quaternion conjugate of q₁+q₂ϵ, q̅₁+q̅₂ϵ.