|
RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
|
Go to the documentation of this file.
33 double radians_angle = deg_angle *
M_PI / 180.0;
41 double radians_angle = deg_angle *
M_PI / 180.0;
43 return sin(radians_angle);
100 va_start(args, format_str);
101 vprintf(format_str, args);
110 puts(
"Not valid input array size !!!");
114 for (uint8_t i = 0; i < arr_size; i++) {
118 return mean / arr_size;
126 double trail_value = 0;
130 puts(
"Not valid input array size !!!");
134 if (window_size <= 0) {
135 puts(
"Not valid window size !!!");
139 for (uint8_t i = 0; i < arr_size; i++) {
140 sum = sum - trail_value + in_arr[i];
141 out_arr[i] = sum / window_size;
144 if (pos >= window_size) {
146 trail_value = in_arr[pos - window_size];
154 int middle = length / 2;
158 if (length % 2 == 1) {
162 return (arr[middle - 1] + arr[middle]) / 2.0;
172 if (fabs(x) > fabs(y)) {
174 sqr_root = fabs(x) * sqrt(1 + sqr_root * sqr_root);
178 sqr_root = fabs(y) * sqrt(1 + sqr_root * sqr_root);
void shell_sort(vector_t *arr, uint8_t length)
Sort a data set of type utils_t by using the Shell sort algorithm.
uint8_t utils_u8_max(uint8_t a, uint8_t b)
Returns the greater of two numbers from type uint8_t.
#define vector_t
Define the data type of the vector elements.
void utils_swap(uint8_t *a, uint8_t *b)
Interchange the values of two variables of type uint8_t.
double utils_sind(double deg_angle)
Compute the sine of a variable in degrees.
double utils_to_radian(double deg_angle)
Convert the angle from degrees to radians.
double utils_get_median(vector_t arr[], uint8_t length)
Compute the median of a finite array of numbers.
Utilities for linear algebra.
uint8_t utils_u8_min(uint8_t a, uint8_t b)
Returns the smaller of two numbers from type uint8_t.
void utils_moving_average(uint8_t arr_size, vector_t in_arr[], uint8_t window_size, vector_t out_arr[])
Compute the moving average of a data set.
double utils_min(double a, double b)
Returns the smaller of two real numbers.
double utils_get_save_square_root(double x, double y)
sqrt(a^2 + b^2) without under/overflow.
Implement the Shell sort algorithm.
double utils_mean(uint8_t arr_size, vector_t in_arr[])
Compute the mean value of a data set.
double utils_max(double a, double b)
Returns the greater of two real numbers.
void utils_printf(char *format_str,...)
Print by using variable format string as well as argument lists.