ape-table-trig-macros

Crates.ioape-table-trig-macros
lib.rsape-table-trig-macros
version0.2.0
sourcesrc
created_at2023-05-09 03:01:13.551644
updated_at2023-05-09 19:21:12.290038
descriptionproc macros for ape-table-trig
homepage
repositoryhttps://github.com/Gip-Gip/ape-table-trig
max_upload_size
id860212
size3,518
Charles Thompson (Gip-Gip)

documentation

README

Ape Table Trigonometry

Implementations of sin, cos, and tan using precalculated tables.

Using these functions can significantly improve performance on systems with limited to no naitive floating point support, like the RP2040. Designed to be no_std compatible out of the box.

Example:

use ape_table_trig::*;

// Table has an accuracy down to 1πmrad
static TABLE: [f32; 1000] = trig_table_gen_f32!(1000);

fn main() {
    let table = TrigTableF32::new(&TABLE);

    // Calculate the sine of 1π radians
    let sine = table.sin(PI_F32);
}
Commit count: 10

cargo fmt