0.1.11 FastTrig

This commit is contained in:
rob tillaart 2022-11-07 10:20:54 +01:00
parent c965e8355f
commit c009e84b8b
7 changed files with 117 additions and 71 deletions

View File

@ -1,3 +1,18 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:
packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
@ -9,3 +24,5 @@ compile:
- esp32
# - esp8266
# - mega2560
- rpipico

View File

@ -0,0 +1,88 @@
# Change Log FastTrig
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.11] - 2022-11-02
- add changelog.md
- add rp2040 to build-CI
- moved version info from readme.md to changelog
- no functional changes
## [0.1.10 2022-04-15
- fix #12
- split .h in .h and .cpp Needed in case of more complex projects.
## [0.1.9] - 2021-12-18
- update Arduino-CI, badges,
- update library.json
- minor edits
## [0.1.8] - 2021-08-10
- made % 180 conditional in itan() => performance gain
- added icot() cotangent.
## [0.1.7] - 2021-04-23
-fix for PlatformIO
## [0.1.6] - 2020-12-23
- Arduino-CI + unit tests
## [0.1.5] - 2020-09-11
- fixed optimize
- new table
- added iasin() and iacos()
In (0.1.4) an error was found in the optimize algorithm, so for 0.1.5
it was ran again and accuracy improved for **isin()** and **icos()**.
However **itan()** lost a (smaller) bit.
The gain outweighs the loss and so new table is kept.
Performance has not changed.
An initial version of a reverse lookup for **iasin(val)** and **iacos(val)**
is added, as it uses the same **isintable16\[\]** interpolation table.
There is no **atan()** or **atan2()** replacement.
## [0.1.4] - 2020-09-08
- rewrite itan()
- cleanup
- examples
The library (0.1.4) provides an **itan()** which improved accuracy
upon the (0.1.3) version and performance for the ESP32.
Performance on AVR (UNO) is still an issue, accuracy is OK.
## [0.1.3] - 2020-09-07
- initial release.
## [0.1.2] - 2020-09-06
- optimize 16 bit table with example sketch
## [0.1.1] - 2020-08-30
- refactor
- create a library out of it.
- itan() approximation is bad.
_eons passed_
----
## [0.1.02] - 2011-08-20
- added interpolation
## [0.1.01] - 2011-08-18
- improved tables a bit
- changed param to float
## [0.1.00] - 2011-08-18
- initial version

View File

@ -1,36 +1,16 @@
//
// FILE: FastTrig.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.1.10
// VERSION: 0.1.11
// PURPOSE: Arduino library for a faster approximation of sin() and cos()
// DATE: 2011-08-18
// URL: https://github.com/RobTillaart/FastTrig
// https://forum.arduino.cc/index.php?topic=69723.0
//
// HISTORY:
// 0.1.00 2011-08-18 initial version
// 0.1.01 2011-08-18 improved tables a bit + changed param to float
// 0.1.02 2011-08-20 added interpolation
// eons passed
// 0.1.1 2020-08-30 refactor, create a library out of it.
// itan() approximation is bad.
// 0.1.2 2020-09-06 optimize 16 bit table with example sketch
// 0.1.3 2020-09-07 initial release.
// 0.1.4 2020-09-08 rewrite itan() + cleanup + examples
// 0.1.5 2020-09-11 fixed optimize, new table, added iasin() and iacos()
// 0.1.6 2020-12-23 Arduino-CI + unit tests
// 0.1.7 2021-04-23 fix for PlatformIO
// 0.1.8 2021-08-10 made % 180 conditional in itan() => performance gain
// added icot() cotangent.
// 0.1.9 2021-12-18 update Arduino-CI, badges,
// update library.json, minor edits
// 0.1.10 2022-04-15 fix #12 split .h in .h and .cpp
#include "FastTrig.h"
// 91 x 2 bytes ==> 182 bytes
// use 65535.0 as divider
uint16_t isinTable16[] = {

View File

@ -2,16 +2,19 @@
//
// FILE: FastTrig.h
// AUTHOR: Rob Tillaart
// VERSION: 0.1.10
// VERSION: 0.1.11
// PURPOSE: Arduino library for a faster approximation of sin() and cos()
// DATE: 2011-08-18
// URL: https://github.com/RobTillaart/FastTrig
// https://forum.arduino.cc/index.php?topic=69723.0
//
// HISTORY: see changelog.md
#include "Arduino.h"
#define FAST_TRIG_LIB_VERSION (F("0.1.10"))
#define FAST_TRIG_LIB_VERSION (F("0.1.11"))
extern uint16_t isinTable16[];

View File

@ -139,7 +139,6 @@ Please, verify the accuracy to see if it meets your requirements.
(added 0.1.5)
ESP32 calls -1 ..+1 step 0.001 degree
| function | max abs error | avg abs error | max rel error | avg rel error |
@ -169,48 +168,9 @@ UNO calls -1 ..+1 step 0.001 degree
Please, verify the accuracy to see if it meets your requirements.
## 0.1.4
## versions
The library (0.1.4) provides an **itan()** which improved accuracy
upon the (0.1.3) version and performance for the ESP32.
Performance on AVR (UNO) is still an issue, accuracy is OK.
## 0.1.5
In (0.1.4) an error was found in the optimize algorithm, so for 0.1.5
it was ran again and accuracy improved for **isin()** and **icos()**.
However **itan()** lost a (smaller) bit.
The gain outweighs the loss and so new table is kept.
Performance has not changed.
An initial version of a reverse lookup for **iasin(val)** and **iacos(val)**
is added, as it uses the same **isintable16\[\]** interpolation table.
There is no **atan()** or **atan2()** replacement.
## 0.1.6
- Arduino-CI + unit tests
## 0.1.7
- fix for PlatformIO
## 0.1.8
- Made the % 180 in the **itan()** conditional.
- added **icot(f)**
## 0.1.9
- update library.json, badges, version string, minor edits.
## 0.1.10
- split .h in .h and .cpp. Needed in case of more complex projects.
See changelog.md
## Operation
@ -221,6 +181,4 @@ See examples
## Future
- How to improve the accuracy of the whole degrees, as now the table is optimized for interpolation.
- version info in release_notes.md file.
- separate releaseNotes.md
- sinc(x) = sin(x)/x function.?

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/FastTrig"
},
"version": "0.1.10",
"version": "0.1.11",
"license": "MIT",
"frameworks": "*",
"platforms": "*",

View File

@ -1,5 +1,5 @@
name=FastTrig
version=0.1.10
version=0.1.11
author=Rob Tillaart <rob.tillaart@gmail.com><pete.thompson@yahoo.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library with interpolated lookup for sin() and cos()