Skip to content

Implementation of sin, cos, and tan functions using tables for accuracy and speed in embedded systems

License

Notifications You must be signed in to change notification settings

Gip-Gip/ape-table-trig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

Implementation of sin, cos, and tan functions using tables for accuracy and speed in embedded systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages