#complex #complex-numbers #quaternions

no-std hcomplex

Lightweight complex and hypercomplex algebra library

3 unstable releases

0.2.0 Dec 5, 2020
0.1.1 May 14, 2019
0.1.0 Apr 18, 2019

#900 in Math

49 downloads per month

MIT/Apache

50KB
1.5K SLoC

hcomplex

Crates.io Docs.rs Travis CI Appveyor Codecov.io License

Lightweight complex and hypercomplex algebra library.

Contents

  • Complex and hypercomplex numbers:
    • Complex<T> - 2-dimensional commutative and associative algebra.
    • Quaternion<T> - 4-dimensional associative but non-commutative algebra.
    • Octonion<T> - 8-dimensional non-commutative and non-associative algebra.
    • Sedenion<T> - 16-dimensional non-commutative and non-associative algebra with nontrivial zero divisors.
    • and following algebras created by Cayley-Dickson construction Construct<T, A<T>> where A<T> is previous algebra.
  • Transformations:
    • transform::Moebius<T, A<T>> - Moebius transform, where A<T> is some algebra.

To construct hypercomplex types from your own type you need to implement Algebra trait for it.

Crate Features

Crate could be used in no_std mode.

  • std - Use std. Enabled by default.
  • random - Hypercomplex number random generator.
  • approx - Approximate comparison of hypercomplex numbers.

Testing

cargo test --features random,approx

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.6–0.9MB
~18K SLoC