22 releases
0.4.4 | Sep 30, 2024 |
---|---|
0.4.3 | May 8, 2022 |
0.4.2 | Mar 20, 2022 |
0.3.1 | Nov 29, 2021 |
#410 in Math
191 downloads per month
35KB
489 lines
Fixed Trigonometry
No-STD fixed-point implementation of trigonometric functions in Rust.
It utilizes the fixed library to allow flexibility in fixed point sizes and precisions.
The package.
The documentation.
Release notes are found under RELEASES.md.
Functionality
The library currently implements:
fft
/ifft
calculation, for complex fixed-point vectors.sin
andcos
using low order polynomails, for real fixed-point numbers.atan
using numerical methods.sqrt
using the Nonlinear IIR Filter (NIIRF) method.powi
andcomplex::powi
calculation.- no-std utilities for complex numbers.
lib.rs
:
No-STD fixed-point numeric implementation of trigonometric functions in Rust.
It utilizes the fixed library to allow flexibility in fixed point sizes and precisions.
The library mixed-num has these functions implemented as traits.
The library NDSP support fixed point numbers in vectors, with various implemented operations.
Example
use fixed_trigonometry::*;
use fixed::{types::extra::U28, FixedI32};
let arg = atan::atan( FixedI32::<U28>::from_num(0.6)/FixedI32::<U28>::from_num(0.4) );
assert_eq!{ arg.to_num::<f32>(), 0.9782037 };
Dependencies
~3.5MB
~65K SLoC