The interpolate 1D array function has a powerful but under appreciated feature of being able to do segmented linear interpolation when the array input is an array of points. (For example in an array of PID profile setpoints). The interpolate function will directly produce the correct interpolated y value for any 'segment' in the array which is very cool. However it does not expose the threshold index which would be very useful and is most certainly already computed internally. In the use case of traversing an array of PID profile setpoints, it would be good to know what segment is being interpolated at any given time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.