GY-63_MS5611/libraries/Complex
2022-10-30 11:11:07 +01:00
..
.github add funding.yml 2022-08-03 21:56:07 +02:00
examples 0.3.1 Complex 2021-12-14 15:48:21 +01:00
test 0.3.2 Complex 2022-10-30 11:11:07 +01:00
.arduino-ci.yml 0.3.2 Complex 2022-10-30 11:11:07 +01:00
CHANGELOG.md 0.3.2 Complex 2022-10-30 11:11:07 +01:00
complex.cpp 0.3.2 Complex 2022-10-30 11:11:07 +01:00
complex.h 0.3.2 Complex 2022-10-30 11:11:07 +01:00
keywords.txt 0.2.4 Complex 2021-10-19 19:44:42 +02:00
library.json 0.3.2 Complex 2022-10-30 11:11:07 +01:00
library.properties 0.3.2 Complex 2022-10-30 11:11:07 +01:00
LICENSE 0.3.1 Complex 2021-12-14 15:48:21 +01:00
README.md 0.3.2 Complex 2022-10-30 11:11:07 +01:00

Arduino CI Arduino-lint JSON check License: MIT GitHub release

Complex

Arduino library for Complex mathematical operations.

Description

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.

Interface

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.

Note

The library has a big footprint so it fills up the memory of an UNO quite fast, especially if all functionality is used.

Known problem

Issue found in version 0.1.9 - https://github.com/RobTillaart/Arduino/issues/90 Class does not compile for DUE and TEENSY Also Raspberry Pico - https://github.com/RobTillaart/Complex/issues/6

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

Solution

  • Make a copy of the Complex Library and rename the folder to CComplex
  • Rename Complex.h to CComplex.h
  • Rename Complex.cpp to CComplex.cpp
  • change one line in CComplex.cpp to include CComplex.h
  • note your sketches need to include CComplex.h too.

Future

  • create a (8 byte) double based variant for high precision e.g. Complex8()
    Note that some platforms map double to float, others support float in hardware etc
    so there is a big difference expected in both memory and performance
  • create the constant i ??