2021-11-09 12:33 PM
How to work with radians in HAL?
I include a math library
#include "math.h"
and trying to implement a formula which has radians
cleansignal = 3.0 * sin (radians (Count));
And CubeIDE gives me an error: undefined reference to` radians'
Solved! Go to Solution.
2021-11-09 12:46 PM
Math functions take radians as an input value. If your value is in degrees, you will need to convert it.
Assuming "Count" is in degrees:
cleansignal = 3.0 * sin (Count * 3.14159f / 180);
2021-11-09 12:46 PM
Math functions take radians as an input value. If your value is in degrees, you will need to convert it.
Assuming "Count" is in degrees:
cleansignal = 3.0 * sin (Count * 3.14159f / 180);