WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
Interpolator.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, INC.
15******************************************************************************/
16#ifndef UTILS_INTERPOLATOR_H
17#define UTILS_INTERPOLATOR_H
18
20#include "types.h"
21
22namespace clockwerk {
42 {
43 public:
55 int16 setData(const floating_point* x_array_ptr, const floating_point* y_array_ptr, uint32 size);
56
62 floating_point getMinX() const;
63
69 floating_point getMaxX() const;
70
81 int16 interpolate(floating_point x, floating_point& y_out);
82
83 private:
84 const floating_point* _x_array_ptr = nullptr;
85 const floating_point* _y_array_ptr = nullptr;
86 uint32 _size = 0;
87
88 uint32 _last_bottom = 0;
89 uint32 _last_top = 1;
90 floating_point _slope = 0.0;
91 };
92}
93
94#endif // UTILS_INTERPOLATE2D_H
A class for performing simple x-y linear interpolation.
Definition Interpolator.h:42
int16 setData(const floating_point *x_array_ptr, const floating_point *y_array_ptr, uint32 size)
Sets the data for the interpolator.
Definition Interpolator.cpp:19
int16 interpolate(floating_point x, floating_point &y_out)
Performs linear interpolation given an x-value.
Definition Interpolator.cpp:70
floating_point getMinX() const
Returns the minimum x-value from the stored data.
Definition Interpolator.cpp:53
floating_point getMaxX() const
Returns the maximum x-value from the stored data.
Definition Interpolator.cpp:61
Definition CircularBuffer.hpp:28