Zephyr API Documentation 4.2.0-rc3
A Scalable Open Source RTOS
|
|
4.2.0-rc3 |
Linear interpolation utilities for mathematical operations. More...
Functions | |
static int32_t | linear_interpolate (const int32_t *x_axis, const int32_t *y_axis, uint8_t len, int32_t x) |
Perform a linear interpolation across an arbitrary curve. |
Linear interpolation utilities for mathematical operations.
|
inlinestatic |
#include <zephyr/math/interpolation.h>
Perform a linear interpolation across an arbitrary curve.
x_axis | Ascending list of X co-ordinates for y_axis data points |
y_axis | Y co-ordinates for each X data point |
len | Length of the x_axis and y_axis arrays |
x | X co-ordinate to lookup |
y_axis[0] | if x < x_axis[0] |
y_axis[len | - 1] if x > x_axis[len - 1] |
int32_t | Linear interpolation between the two nearest y_axis values. |