ape-table-trig

Crates.ioape-table-trig
lib.rsape-table-trig
version0.2.0
sourcesrc
created_at2023-05-09 03:01:25.376866
updated_at2023-05-09 19:21:33.704
descriptionimplementations of sin, cos, and tan using precalculated tables
homepage
repositoryhttps://github.com/Gip-Gip/ape-table-trig
max_upload_size
id860213
size13,607
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