SofaPirate / Plaquette

Object-oriented Arduino library for creative physical computing
https://sofapirate.github.io/Plaquette/
GNU General Public License v3.0
15 stars 4 forks source link

Get more precision by using sin(x) approximation with 24 or 32 bits instead of 16 bits #101

Open sofian opened 7 months ago

sofian commented 7 months ago

Currently the pq_trig8.h is used to compute quickly sin(x) in Plaquette, however this approach is much less precise than the 24-bits resolution of floats. Could we improve precision without hampering speed too much?

sofian commented 5 months ago

See this https://chat.openai.com/c/108e2fd3-f702-4c7f-84ca-208c0beab9bf Also: https://www.coranac.com/2009/07/sines/

sofian commented 5 months ago

Also this P5/java library contains a FastMath class with pretty interesting functions to efficiently compute math functions: https://sourceforge.net/projects/sprites4processing/