GY-63_MS5611/libraries/Complex/README.md

96 lines
3.1 KiB
Markdown
Raw Normal View History

2021-01-29 06:31:58 -05:00
[![Arduino CI](https://github.com/RobTillaart/Complex/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
2021-09-14 05:58:53 -04:00
[![Arduino-lint](https://github.com/RobTillaart/Complex/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Complex/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/Complex/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Complex/actions/workflows/jsoncheck.yml)
2023-10-18 11:17:06 -04:00
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/Complex.svg)](https://github.com/RobTillaart/Complex/issues)
2021-01-29 06:31:58 -05:00
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Complex/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/Complex.svg?maxAge=3600)](https://github.com/RobTillaart/Complex/releases)
2023-10-18 11:17:06 -04:00
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/Complex.svg)](https://registry.platformio.org/libraries/robtillaart/Complex)
2021-01-29 06:31:58 -05:00
2021-09-14 05:58:53 -04:00
2020-11-27 05:10:47 -05:00
# Complex
2021-09-14 05:58:53 -04:00
Arduino library for Complex mathematical operations.
2020-11-27 05:10:47 -05:00
## Description
2021-09-14 05:58:53 -04:00
This library defines the complex data type and all the common mathematical functions for it.
These functions include basic = "+ - \* /" and also power and goniometric functions.
The library implements the **Printable** interface so one can directly print the complex values
in any stream e.g. Serial.
2020-11-27 05:10:47 -05:00
2021-01-29 06:31:58 -05:00
## Interface
2020-11-27 05:10:47 -05:00
2023-10-18 11:17:06 -04:00
```cpp
#include "Complex.h"
```
2021-09-14 05:58:53 -04:00
See Complex.h for a full list of functions implemented.
The library uses **float** for the real and imaginary part so precision is limited.
Reasons are memory and performance, see also Future section below.
The library implements the constant **one** as this value is often used in the code.
2020-11-27 05:10:47 -05:00
## Note
2021-01-29 06:31:58 -05:00
2021-09-14 05:58:53 -04:00
The library has a big footprint so it fills up the memory of an UNO quite fast,
especially if all functionality is used.
2020-11-27 05:10:47 -05:00
2021-01-29 06:31:58 -05:00
#### Known problem
2020-11-27 05:10:47 -05:00
Issue found in version 0.1.9 - https://github.com/RobTillaart/Arduino/issues/90
Class does not compile for DUE and TEENSY
2021-11-08 07:19:48 -05:00
Also Raspberry Pico - https://github.com/RobTillaart/Complex/issues/6
2020-11-27 05:10:47 -05:00
Apparently the name "Complex" is already in use (reserved) by some non-AVR compilers
so it won't include the Complex.h file. Problem seen on Due and Teensy3.5
2021-09-14 05:58:53 -04:00
#### Solution
- Make a copy of the Complex Library and rename the folder to CComplex
2020-11-27 05:10:47 -05:00
- Rename Complex.h to CComplex.h
2021-09-14 05:58:53 -04:00
- Rename Complex.cpp to CComplex.cpp
2020-11-27 05:10:47 -05:00
- change one line in CComplex.cpp to include CComplex.h
2021-09-14 05:58:53 -04:00
- note your sketches need to include CComplex.h too.
## Future
2023-10-18 11:17:06 -04:00
#### Must
- improve documentation
#### Should
#### Could
2021-09-14 05:58:53 -04:00
- create a (8 byte) double based variant for high precision e.g. Complex8()
2023-10-18 11:17:06 -04:00
- Note that some platforms map double to float
- others support float in hardware etc.
- so expect a big difference in both memory and performance.
#### Wont
2021-09-14 05:58:53 -04:00
- create the constant **i** ??
2023-10-18 11:17:06 -04:00
- => expect conflicts with int i...
## Support
If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.
Thank you,
2021-09-14 05:58:53 -04:00
2020-11-27 05:10:47 -05:00