Home
last modified time | relevance | path

Searched refs:x_axis (Results 1 – 3 of 3) sorted by relevance

/Zephyr-latest/tests/lib/math/interpolation/src/
Dmain.c13 int32_t x_axis[] = {10, 20, 30, 40, 50}; in ZTEST() local
15 uint8_t len = ARRAY_SIZE(x_axis); in ZTEST()
17 zassert_equal(ARRAY_SIZE(x_axis), ARRAY_SIZE(y_axis)); in ZTEST()
19 zassert_equal(y_axis[0], linear_interpolate(x_axis, y_axis, len, INT32_MIN)); in ZTEST()
20 zassert_equal(y_axis[0], linear_interpolate(x_axis, y_axis, len, -1)); in ZTEST()
21 zassert_equal(y_axis[0], linear_interpolate(x_axis, y_axis, len, 0)); in ZTEST()
22 zassert_equal(y_axis[0], linear_interpolate(x_axis, y_axis, len, x_axis[0] - 1)); in ZTEST()
24 zassert_equal(y_axis[4], linear_interpolate(x_axis, y_axis, len, x_axis[4] + 1)); in ZTEST()
25 zassert_equal(y_axis[4], linear_interpolate(x_axis, y_axis, len, 100)); in ZTEST()
26 zassert_equal(y_axis[4], linear_interpolate(x_axis, y_axis, len, INT32_MAX)); in ZTEST()
[all …]
/Zephyr-latest/include/zephyr/math/
Dinterpolation.h37 static inline int32_t linear_interpolate(const int32_t *x_axis, const int32_t *y_axis, uint8_t len, in linear_interpolate() argument
45 if (x <= x_axis[0]) { in linear_interpolate()
47 } else if (x >= x_axis[len - 1]) { in linear_interpolate()
52 while (x >= x_axis[idx_low + 1]) { in linear_interpolate()
57 x_shifted = x - x_axis[idx_low]; in linear_interpolate()
64 run = x_axis[idx_low + 1] - x_axis[idx_low]; in linear_interpolate()
/Zephyr-latest/drivers/sensor/bosch/bmg160/
Dbmg160.c206 uint16_t x_axis; in bmg160_sample_fetch() member
218 bmg160->raw_gyro_xyz[0] = sys_le16_to_cpu(buf.x_axis); in bmg160_sample_fetch()